#setting_products {
  // * ----------------
  // มีบางส่วนใช้ร่วมกับ หน้า _setting.scss
  // ----------------
  .addCategory{
  	display: flex;
    justify-content: flex-end;
  }
  .categories{
    margin-top: 20px;
    border-top: 1px solid #ddd;
    &__item{
      padding: 17px;
      padding-right: 27px;
      border-bottom: 1px solid #ddd;
      font-weight: 500;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      position: relative;
      &--down{
        content: '';
        display: block;
        width: 20px;
        height: 20px;
        background: url(../../imgs/down.svg);
        background-repeat: no-repeat;
        background-position: center;
        background-size: 13px;
        position: absolute;
        right: 10px;
      }

      &--edit{
        padding: 0 15px;
        display: none;
        img{
          width: 17px;
        }
      }
      &.active{
        color: #004f9c;
        background-color: #F9F9F9;
        border-bottom: 0px;
        .categories__item--down{
          transform: rotate(180deg);
        }
        .categories__item--edit{
          display: block;
        }
      }
    }
  }
  .products{
    display: none;
    padding: 17px 27px;
    background-color: #F9F9F9;
    border-bottom: 1px solid #ddd;
    &__title{
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    &__lists{
      margin-top: 10px;
      &--item{
        display: flex;
        align-items: center;
        padding: 10px;
        background-color: #fff;
        border-bottom: 1px solid #ddd;
        cursor: move;
        .edit{
          display: flex;
          align-items: center;
          width: 100%;
          cursor: pointer;
        }
        .pKey{
          width: 30px;
        }
        .pImg{
          width: 80px;
          height: 80px;
          background-position: center;
          background-repeat: no-repeat;
          background-size: cover;
          background-color: #ddd;
        }
        .pName{
          width: calc(100% - 30px - 80px - 100px);
          padding-left: 15px;
        }
        .pPrice{
          width: 100px;
          padding-right: 10px;
          text-align: right;
        }
        .pRecommend{
          cursor: pointer;
          width: 50px;
          text-align: center;
          svg{
            width: 20px;
            height: 20px;
            fill: transparent;
            stroke: #000;
          }

          &.recommend{
            svg{
              fill: #ffc107;
              stroke: #ffc107;
            }
          }
        }

        .action {
          display: flex;
          align-items: center;
          justify-content: space-between;
        }
      }
    }
  }

  .categories__item {
    &.hide {
      display: flex !important;
      color: #ddd;
    }
  }

  @media only screen and (max-width: 992px) {
  	.addProduct{
	    margin-bottom: 20px;
	    width: 100%;
	    padding: 10px;
    }


    .products__lists {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;

      &--item {
        display: block;
        width: 48%;
        width: 100%;
        margin-bottom: 10px;
        
        .edit {
          display: block;
          margin-bottom: 10px;
          position: relative;
        }

        .pKey {
          position: absolute;
          width: 30px;
          height: 30px;
          background: #fff;
          display: flex;
          justify-content: center;
          align-items: center;
          border-radius: 50%;
          font-weight: 500;
          margin: 5px;
        }

        .pImg {
          position: relative;
          width: 100%;
          padding-bottom: 100%;
          margin-bottom: 10px;
        }

        .pName {
          width: 100%;
          padding-left: 0;
        }
        
        .pPrice {
          position: absolute;
          right: 0px;
          bottom: 0px;
          background: #fff;
          width: unset;
          padding: 5px 10px;
          font-weight: 500;
        }

        .action {

          .pRecommend {
            text-align: left;
          }

          .pEnable {
            label {
              margin: 0;
            }
          }

          
        }
      }

    }

  	// .products{
  	// 	td{
  	// 		font-size: 13px;
	  //     &:first-child{
	  //     	padding: 5px;
	  //     }
	  //     &:nth-child(2){
		 //  		img{
		 //  			width: 50px;
		 //  		}
	  //   	}
	  //   	&:last-child{
	  //   		div{flex-wrap: wrap;}
	  //   		.product_btn{
	  //   			margin: 5px;
   //  				padding: 5px;
	  //   		}
	  //   	}
	  //   }
  	// }
  }
}

#upload_modal {
  // #gallery {
	// 	display: flex;
	// 	flex-flow: wrap;
	// }
	// .gallery-image {
	// 	width: 33.33%;
	// 	position: relative;
	// }
	// .gallery-image img {
	// 	width: 100%;
	// }
	// .modal-body {
	// 	overflow-y: auto;
	// 	max-height: 64vh;
	// }
	// .gallery-delete {
	// 	position: absolute;
	// 	bottom: 5px;
	// 	right: 5px;
	// 	z-index: 1;
	// 	border: unset;
	// 	color: #fff;
	// 	background: rgb(0 0 0 / 0.6);
	// 	border-radius: 50%;
	// 	width: 30px;
	// 	height: 30px;
	// 	display: flex;
	// 	justify-content: center;
	// 	align-items: center;
	// }
	// .gallery-image.active:after {
	// 	content: "";
	// 	background: #000;
	// 	width: 100%;
	// 	height: 100%;
	// 	position: absolute;
	// 	top: 0;
	// 	left: 0;
	// 	opacity: 0.3;
	// }
	// .gallery-selected {
	// 	cursor: default;
	// 	z-index: 1;
	// 	position: absolute;
	// 	top: 5px;
	// 	right: 5px;
	// 	background: #004f9c;
	// 	color: #fff;
	// 	border-radius: 50%;
	// 	width: 30px;
	// 	height: 30px;
	// 	display: flex;
	// 	justify-content: center;
	// 	align-items: center;
	// 	border: 2px solid #fff;
	// }

	// #page_crop .modal-footer {
	// 	display: flex;
	// 	justify-content: space-between;
	// }
	// #page_crop .modal-body {
	// 	padding: 0;
	// 	min-height: 418px;
	// }

	// .cr-tool-container {
	// 	text-align: right;
	// 	width: 100%;
	// 	background: rgb(0 0 0 / 0.6);
	// 	padding: 0 20px;
	// }

	// .croppie-container .cr-slider-wrap {
	// 	position: absolute;
	// 	bottom: 0;
	// 	display: flex;
	// 	align-items: center;
	// 	justify-content: center;
	// 	margin: 10px auto;
	// }

	// #crop_rotate {
	// 	background: unset;
	// 	border: unset;
	// }

	// #crop_rotate:focus {
	// 	outline: 0;
	// 	outline-offset: 0;
	// 	box-shadow: unset;
	// }

	#crop_preview {
		width: 100%;
		display: flex;
  }
  
  .crop-container {
    position: relative;
    padding-bottom: 70%;

    #crop_preview {
      position: absolute;
    }

    .cr-slider-wrap {
      position: absolute;
      bottom: -40px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 10px auto;
      margin-left: 10px;
    }
  }

  #gallery {
		display: flex;
		flex-flow: wrap;
	}
	.gallery-image {
		width: 33.33%;
		position: relative;
	}
	.gallery-image img {
		width: 100%;
	}
	.modal-body {
		overflow-y: auto;
		max-height: 64vh;
	}
	// .gallery-delete {
	// 	position: absolute;
	// 	bottom: 5px;
	// 	right: 5px;
	// 	z-index: 1;
	// 	border: unset;
	// 	color: #fff;
	// 	background: rgb(0 0 0 0 0.6);
	// 	border-radius: 50%;
	// 	width: 30px;
	// 	height: 30px;
	// 	display: flex;
	// 	justify-content: center;
	// 	align-items: center;
	// }
	.gallery-image.active:after {
		content: "";
		background: #000;
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
		opacity: 0.3;
	}
	

	#page_crop .modal-footer {
		display: flex;
    justify-content: space-between;
    // justify-content: flex-end;
	}
	#page_crop .modal-body {
		padding: 0;
		min-height: 418px;
  }
  
  .croppie-container .cr-slider-wrap {
		position: absolute;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
    margin: 10px auto;
    z-index: 1;
    margin-left: 10px;
  }
  
  .gallery-selected {
		cursor: default;
		z-index: 1;
		position: absolute;
		top: 5px;
		right: 5px;
		background: #004f9c;
		color: #fff;
		border-radius: 50%;
		width: 30px;
		height: 30px;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 2px solid #fff;
	}

	.cr-tool-container {
		text-align: right;
		width: 100%;
		background: #00000099;
		padding: 0 20px;
	}

	#crop_rotate {
		background: unset;
		border: unset;
	}

	#crop_rotate:focus {
		outline: 0;
		outline-offset: 0;
		box-shadow: unset;
	}

	#crop_preview {
    width: 100%;
    height: 100%;
		display: flex;
	}

  .cr-tool-container {
    position: absolute !important;
    bottom: 0 !important;
  }

  .crop-save {
    background-color: #004f9c;
    color: #fff;
    float: right; 
  }

  .modal-footer:before, .modal-footer:after {
    display: unset;
    content: unset;
  }

  @media only screen and (max-width: 992px) {
    .cr-slider-wrap {
      position: absolute !important;
      bottom: -180px !important;
      
    }

    .cr-tool-container {
      position: absolute !important;
      bottom: 0 !important;
    }
  }
}

#modal_product{
	.modal-header{
    padding: 0 30px;
    .title{
  		font-weight: 700;
  		font-size: 22px;
      padding: 15px 0;
    }
    .tabs{
      display: flex;
      &__item{
        padding: 10px 0;
        margin: 0 15px;
        font-weight: bold;
        border-bottom: 3px solid #004f9c;
        border-color: transparent;
        &.active{
          color: #004f9c;
          border-color: #004f9c;
        }
        &:first-child{
          margin-left: 0px;
        }
      }
    }
	}
	.modal-body{
		padding: 15px 40px;
	}
  .modal-footer{
    text-align: left;
  }
	.product{
		&__line{
			display: flex;
	    align-items: center;
	    margin-bottom: 15px;
	    position: relative;
	    width: fit-content;

	    &--title{
	    	width: 120px;
		    min-width: 120px;
		    font-weight: 500;
		    font-size: 16px;
        span{
          font-size: 14px;
          font-weight: lighter;
        }
	    }
	    input{
  	    border: 1px solid #ddd;
		    padding: 10px 20px;
		    border-radius: 3px;
		    font-size: 16px;
	    }
	    &--img{
	    	position: relative;
        width: 250px;
        height: 250px;
        overflow: hidden;
        background: #ddd;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
        img{
    	    max-width: 100%;
    			max-height: 100%;
        }
	    }
	    &--file {
		    position: absolute;
		    right: 5px;
		    top: 5px;
		    background: rgba(127,127,127,.5);
		    padding: 3px;
		    cursor: pointer;
		    border-radius: 100%;
		    display: flex;
        z-index: 9;
		    input[type=file] {
			    width: 100%;
			    height: 100%;
			    position: absolute;
			    left: 0;
			    top: 0;
			    padding: 0;
			    border: 0;
			    cursor: pointer;
			    opacity: 0;
				}
				img {
			    width: 20px;
			    height: 20px;
			    cursor: pointer;
				}
			}
      .dropdown{
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 3px;
        width: fit-content;
      }
		}
	}
  .product-delete{
    text-decoration: underline;
    font-size: 14px;
    color: red;
    cursor: pointer;
  }
  .product-close{
    float: right;
    margin-right: 10px;
  }
	.product-submit{
		background-color: #004f9c;
    color: #fff;
    float: right;
	}

  #tab_product_options{
    padding: 30px;
    background-color: #f2f2f2;
  }

  .productsOptions{
    padding: 0;
    margin-top: 10px;
    &__line{
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      &--title{
        font-weight: 500;
        font-size: 16px;
        margin-right: 20px;
        span{
          font-size: 14px;
          font-weight: lighter;
        }
      }
    }
    &__add{
      color: #004f9c;
      border: 1px solid #004f9c;
      border-radius: 3px;
      padding: .5em .8em;
      width: fit-content;
      cursor: pointer;
      font-weight: 500;
    }

    &__item{
      margin-bottom: 10px;
      border: 1px solid #ddd;
      border-radius: 3px;
      background-color: #fff;
      cursor: move;
      &--name{
        cursor: pointer;
        padding: 15px 30px;
        width: 100%;
      }
      &--header{
        display: flex;
        align-items: center;
        justify-content: space-between;
        input{
          padding: 0.5em;
          width: 100%;
          border: 1px solid #888;
          border-radius: 3px;
          &:disabled{
            border-color: transparent;
            background: transparent;
          }
        }
        .option{
          &__btn{
            width: 20px;
            margin: 10px;
            cursor: pointer;
            img{
              max-width: 100%;
              max-height: 100%;
            }
          }
          &__move{
            cursor: move;
          }
        }

        .option_switch{
          padding: 15px 25px;
        }
      }
      &--body{
        margin-top: 20px;
        display: none;
      }
      &--footer{
        margin-top: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .option__delete{
          font-size: 14px;
          color: red;
          text-decoration: underline;
          cursor: pointer;
        }
      }
      &--line{
        display: flex;
        align-items: center;
        margin-bottom: 15px;
        position: relative;

        input{
          border: 1px solid #ddd;
          padding: 10px 20px;
          border-radius: 3px;
          font-size: 16px;
        }
        .dropdown {
          font-size: 16px;
          border: 1px solid #ddd;
          border-radius: 3px;
          width: fit-content;
        }
        .styled-checkbox+label{
          font-weight: 100;
          margin-right: 20px;
          font-size: 16px;
        }
        .styled-checkbox+label:before{
          border: 1px solid #ccc;
        }
        .styled-checkbox:checked+label:before{
          background: #004f9c;
          border-color: transparent;
        }
        .styled-checkbox:checked+label:after{
          background-color: #fff;
          box-shadow: 2px 0 0 #fff, 4px 0 0 #fff, 4px -2px 0 #fff, 4px -4px 0 #fff, 4px -6px 0 #fff, 4px -8px 0 #fff;
        }
      }
      &--title{
        width: 80px;
        min-width: 80px;
        font-weight: 500;
        font-size: 16px;
      }
      &--remark{
        font-size: 12px;
        margin-top: 10px;
        color: #888;
      }
      .option_limit{
        display: flex;
        align-items: center;
        margin: 0 10px;
        &__delete{
          line-height: 1.3;
          width: 1.5em;
          font-size: 20px;
          text-align: center;
          font-weight: 500;
          border: 1px solid #ddd;
          border-radius: 4px 0 0 4px;
          margin-right: -1px;
        }
        &__add{
          line-height: 1.3;
          width: 1.5em;
          font-size: 20px;
          text-align: center;
          font-weight: 500;
          border: 1px solid #ddd;
          border-radius: 0 4px 4px 0;
          margin-left: -1px;
        }
        &__quantity {
          width: 2em;
          font-weight: 500;
          line-height: 1.6;
          border-radius: 0;
          text-align: center;
          padding: 1px;
          font-size: 15px;
        }
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }
        &.disabled{
          background-color: #f2f2f2;
        }
      }
      .option_price{
        position: relative;
        display: flex;
        align-items: center;
        &::after{
          content: '฿';
          display: block;
          position: absolute;
          right: 7px;
          color: #888;
        }
      }
      &--options{
        align-items: flex-start;
        .productsOptions__item--title{
          padding-top: 10px;
        }
      }
      &--optionsitem{
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #ccc;
        width: 100%;
        padding: 10px 0;
        input{
          padding: 0.5em;
          width: 80px !important;
          position: relative;
          text-align: right;
          padding-right: 1.5em;
        }
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }

        &.title{
          font-weight: 500;
        }
      }
      &--limit{
        display: none;
      }

      input{
        width: 100%;
      }
      select{
        padding: 0.3em 0.5em;
        border: 1px solid #888;
        border-radius: 3px;
        width: 100%;

        &:focus{
          outline: none;
        }
        &:disabled{
          background-color: #f2f2f2;
          border-color: #ddd;
        }
      }

      .optionsitem,.products_options_name{
        width: 100%;
      }

      &.open{
        padding: 15px 30px;
        .productsOptions__item--header{
          display: none;
        }
        .productsOptions__item--body{
          display: block;
        }
      }

      .products_options{
        display: none;
      }

      &--checkbox{
        position: relative;
        input{
          position: absolute;
          height: 100%;
        }
        .styled-checkbox+label{
          margin: 0;
        }
      }
    }

    &__none{
      display: flex;
      min-height: 300px;
      flex-flow: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      &--title{
        font-weight: 500;
        color: #999;
        margin-bottom: 15px;
        font-size: 14px;
      }
    }

    &__submit{
      background-color: #004f9c;
      color: #fff;
    }
  }

  .dropdown{
    .btn-default{
      min-width: 245px;
      text-align: left;
      display: inline-flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 20px;
    }
  }


	@media only screen and (max-width: 992px) {
		.product{
			&__line{
				flex-wrap: wrap;
				&--title{
					width: 100%;
					margin-bottom: 10px;
				}
				&--img{
					width: 200px;
					height: 200px;
				}
			}
		}
    #tab_product_options{
      padding: 15px;
    }
    .productsOptions{
      &__item{
        padding: 15px;
        &--line{
          flex-wrap: wrap;
        }
        &--title{
          width: 100%;
          margin-bottom: 10px;
        }
      }
    }
  }
}
