/* =========================================================
   EDIT PRODUCT PAGE
========================================================= */

.edit-product-page {
    max-width: 1250px;
    margin: 0 auto;
    padding-bottom: 40px;
}


/* =========================================================
   PRODUCT HEADER
========================================================= */

.edit-product-hero {
    display: flex;
    align-items: center;
    gap: 22px;

    padding: 22px 24px;
    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #e5ebe1;
    border-radius: 14px;

    box-shadow: 0 4px 18px rgba(36, 59, 42, 0.04);
}


.edit-product-hero-image {
    width: 90px;
    height: 90px;

    flex-shrink: 0;

    overflow: hidden;

    background: #edf3e9;

    border-radius: 12px;
}


.edit-product-hero-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.edit-product-no-image {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8ca085;

    font-size: 28px;
}


.edit-product-hero-info {
    min-width: 0;
}


.edit-product-eyebrow {
    display: block;

    margin-bottom: 5px;

    color: #66835d;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.2px;
    text-transform: uppercase;
}


.edit-product-hero-info h2 {
    margin: 0;

    color: #243b2a;

    font-size: 24px;
    font-weight: 700;
}


.edit-product-slug {
    margin: 5px 0 12px;

    color: #8a9285;

    font-size: 12px;
}


.edit-product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;
}


.edit-product-meta > span {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 6px 10px;

    background: #f4f7f1;

    border-radius: 6px;

    color: #64705f;

    font-size: 10px;
    font-weight: 600;
}


.edit-product-meta i {
    color: #78956d;
}


.product-status.active {
    background: #eaf4e7 !important;
    color: #47723d !important;
}


.product-status.active i {
    color: #5b984f;
    font-size: 7px;
}


.product-status.inactive {
    background: #f2f3f1 !important;
    color: #777d74 !important;
}


.product-status.inactive i {
    color: #9b9f98;
    font-size: 7px;
}



/* =========================================================
   MAIN INFORMATION GRID
========================================================= */

.edit-product-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(320px, 1fr);

    gap: 20px;
}



/* =========================================================
   SECTION CARDS
========================================================= */

.edit-section {
    overflow: hidden;

    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #e4eadf;
    border-radius: 14px;

    box-shadow: 0 4px 16px rgba(36, 59, 42, 0.035);
}


.edit-section-header {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 18px 21px;

    border-bottom: 1px solid #edf0eb;
}


.edit-section-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #edf4e9;

    border-radius: 9px;

    color: #54764b;

    font-size: 14px;
}


.edit-section-header h3 {
    margin: 0 0 3px;

    color: #293d2c;

    font-size: 15px;
    font-weight: 700;
}


.edit-section-header p {
    margin: 0;

    color: #899087;

    font-size: 11px;
}


.edit-section-body {
    padding: 21px;
}



/* =========================================================
   FORM
========================================================= */

.edit-form-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(200px, .8fr);

    gap: 17px;

    margin-bottom: 17px;
}


.form-group {
    margin-bottom: 17px;
}


.form-label {
    display: block;

    margin-bottom: 7px;

    color: #3d493a;

    font-size: 11px;
    font-weight: 700;
}


.form-input,
.form-select,
.form-textarea {
    width: 100%;

    border: 1px solid #dfe6db;
    border-radius: 8px;

    background: #ffffff;

    color: #2d382c;

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


.form-input,
.form-select {
    height: 42px;

    padding: 0 12px;
}


.form-textarea {
    min-height: 115px;

    padding: 12px;

    resize: vertical;

    line-height: 1.5;
}


.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #7d9d73;

    box-shadow:
        0 0 0 3px rgba(101, 134, 91, .10);
}


.form-input::placeholder,
.form-textarea::placeholder {
    color: #adb5aa;
}


.form-help {
    margin-top: 6px;

    color: #929a8e;

    font-size: 10px;
    line-height: 1.5;
}


.edit-description {
    min-height: 135px;
}


.seo-description {
    min-height: 100px;
}



/* =========================================================
   ACTIVE PRODUCT
========================================================= */

.product-active-toggle {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px 14px;

    background: #f7f9f5;

    border: 1px solid #e7ece3;
    border-radius: 9px;

    cursor: pointer;
}


.product-active-check {
    position: relative;

    width: 20px;
    height: 20px;

    flex-shrink: 0;
}


.product-active-check input {
    position: absolute;

    width: 20px;
    height: 20px;

    opacity: 0;

    cursor: pointer;
}


.custom-checkbox {
    width: 20px;
    height: 20px;

    display: block;

    background: #ffffff;

    border: 1px solid #cbd5c6;
    border-radius: 5px;
}


.product-active-check input:checked + .custom-checkbox {
    background: #4f7547;

    border-color: #4f7547;
}


.product-active-check input:checked + .custom-checkbox::after {
    content: "\f00c";

    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;

    color: #ffffff;

    font-family: "Font Awesome 6 Free";
    font-size: 10px;
    font-weight: 900;
}


.product-active-toggle strong {
    display: block;

    color: #344431;

    font-size: 12px;
}


.product-active-toggle small {
    display: block;

    margin-top: 2px;

    color: #8b9388;

    font-size: 10px;
}



/* =========================================================
   SEO
========================================================= */

.seo-tip {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    padding: 11px 12px;

    background: #f4f8f1;

    border-radius: 8px;

    color: #687362;

    font-size: 10px;
    line-height: 1.5;
}


.seo-tip i {
    margin-top: 2px;

    color: #77966c;
}



/* =========================================================
   VARIANTS
========================================================= */

.variants-section {
    margin-bottom: 20px;
}


.variant-table-wrapper {
    overflow-x: auto;

    padding: 0 21px 4px;
}


.variant-table-head,
.variant-edit-row {
    min-width: 850px;

    display: grid;

    grid-template-columns:
        1.25fr
        1fr
        .85fr
        1fr
        120px;

    gap: 13px;

    align-items: center;
}


.variant-table-head {
    padding: 15px 13px 8px;

    color: #90988e;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .8px;
    text-transform: uppercase;
}


.variant-edit-row {
    padding: 13px;

    margin-bottom: 8px;

    background: #f9faf8;

    border: 1px solid #edf0eb;
    border-radius: 10px;
}


.variant-field {
    min-width: 0;
}


.variant-field label {
    display: none;

    margin-bottom: 6px;

    color: #6d7669;

    font-size: 10px;
    font-weight: 700;
}


.price-input {
    position: relative;
}


.price-input > span {
    position: absolute;

    left: 12px;
    top: 50%;

    transform: translateY(-50%);

    color: #7d8978;

    font-size: 11px;
    font-weight: 700;

    pointer-events: none;
}


.price-input input {
    padding-left: 27px;
}



/* =========================================================
   AVAILABILITY
========================================================= */

.variant-available {
    display: flex;
    align-items: center;
}


.availability-toggle {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    cursor: pointer;
}


.availability-toggle input {
    display: none;
}


.availability-switch {
    position: relative;

    width: 34px;
    height: 19px;

    display: block;

    background: #d8ddd5;

    border-radius: 20px;

    transition: background .2s ease;
}


.availability-switch::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 13px;
    height: 13px;

    background: #ffffff;

    border-radius: 50%;

    box-shadow: 0 1px 3px rgba(0,0,0,.15);

    transition: transform .2s ease;
}


.availability-toggle input:checked + .availability-switch {
    background: #628759;
}


.availability-toggle input:checked + .availability-switch::after {
    transform: translateX(15px);
}


.availability-text {
    color: #596456;

    font-size: 10px;
    font-weight: 700;
}



/* =========================================================
   EMPTY VARIANTS
========================================================= */

.empty-variants {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 40px 20px;

    color: #899187;

    text-align: center;
}


.empty-variants i {
    margin-bottom: 10px;

    color: #b1b9ad;

    font-size: 26px;
}


.empty-variants strong {
    margin-bottom: 4px;

    color: #596255;

    font-size: 12px;
}


.empty-variants span {
    font-size: 10px;
}



/* =========================================================
   INFORMATION NOTE
========================================================= */

.edit-section-note {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin: 15px 21px 20px;

    padding: 11px 13px;

    background: #f7f9f5;

    border-radius: 8px;

    color: #7b8477;

    font-size: 10px;
    line-height: 1.5;
}


.edit-section-note i {
    margin-top: 2px;

    color: #82977a;
}



/* =========================================================
   NEW VARIANTS
========================================================= */

.new-variants-section {
    background: #fbfcfa;
}


.new-variants-body {
    padding: 20px 21px;
}


.new-variant-row {
    position: relative;

    display: grid;

    grid-template-columns:
        1.25fr
        1fr
        .85fr
        1fr
        36px;

    gap: 13px;

    align-items: end;

    padding: 16px;

    margin-bottom: 10px;

    background: #ffffff;

    border: 1px dashed #ccd8c8;
    border-radius: 10px;
}


.remove-variant-button {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e1e5df;
    border-radius: 7px;

    background: #ffffff;

    color: #929990;

    cursor: pointer;

    transition: all .2s ease;
}


.remove-variant-button:hover {
    border-color: #d8bcbc;

    background: #fbf2f2;

    color: #a85c5c;
}


.add-variant-button {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    height: 38px;

    padding: 0 13px;

    border: 1px solid #cbd9c6;
    border-radius: 7px;

    background: #f3f8f0;

    color: #4f7048;

    font-family: inherit;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition: all .2s ease;
}


.add-variant-button:hover {
    background: #eaf3e6;

    border-color: #b9ccb3;
}



/* =========================================================
   PRODUCT IMAGES
========================================================= */

.images-body {
    padding: 21px;
}


.product-image-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(145px, 1fr));

    gap: 14px;

    margin-bottom: 21px;
}


.product-image-card {
    position: relative;

    height: 150px;

    overflow: hidden;

    background: #f3f5f1;

    border: 1px solid #e1e7de;
    border-radius: 10px;
}


.product-image-card img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.primary-image-badge {
    position: absolute;

    left: 8px;
    bottom: 8px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 5px 8px;

    background: rgba(36, 59, 42, .9);

    border-radius: 5px;

    color: #ffffff;

    font-size: 9px;
    font-weight: 700;
}


.primary-image-badge i {
    font-size: 8px;
}



/* =========================================================
   EMPTY IMAGES
========================================================= */

.empty-images {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 35px 20px;

    margin-bottom: 20px;

    background: #f8faf7;

    border: 1px dashed #d8dfd4;
    border-radius: 10px;

    text-align: center;
}


.empty-images i {
    margin-bottom: 10px;

    color: #aab4a6;

    font-size: 25px;
}


.empty-images strong {
    margin-bottom: 4px;

    color: #5f695c;

    font-size: 12px;
}


.empty-images span {
    color: #929a8e;

    font-size: 10px;
}



/* =========================================================
   IMAGE UPLOAD
========================================================= */

.image-upload-area {
    position: relative;

    min-height: 150px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background: #f8fbf6;

    border: 1px dashed #bfcfba;
    border-radius: 10px;

    text-align: center;

    cursor: pointer;

    transition: all .2s ease;
}


.image-upload-area:hover {
    background: #f1f7ee;

    border-color: #8faa84;
}


.image-upload-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 9px;

    background: #e7f0e3;

    border-radius: 50%;

    color: #63885a;

    font-size: 16px;
}


.image-upload-area strong {
    color: #4e6549;

    font-size: 12px;
}


.image-upload-area span {
    margin-top: 4px;

    color: #8b9587;

    font-size: 10px;
}


.image-upload-area small {
    margin-top: 8px;

    color: #a0a79d;

    font-size: 9px;
}


.image-upload-area input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}



/* =========================================================
   SAVE BAR
========================================================= */

.edit-product-actions {
    position: sticky;

    bottom: 15px;

    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 18px;

    background: rgba(255,255,255,.97);

    border: 1px solid #dfe6da;
    border-radius: 12px;

    box-shadow: 0 8px 30px rgba(36,59,42,.10);
}


.edit-actions-info {
    display: flex;
    align-items: center;

    gap: 8px;

    color: #81897d;

    font-size: 10px;
}


.edit-actions-info i {
    color: #78946f;
}


.edit-actions-buttons {
    display: flex;
    align-items: center;

    gap: 9px;
}


.cancel-button,
.save-product-button {
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 0 16px;

    border-radius: 7px;

    font-family: inherit;

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;
}


.cancel-button {
    background: #ffffff;

    border: 1px solid #dfe4dc;

    color: #667061;
}


.cancel-button:hover {
    background: #f7f8f6;
}


.save-product-button {
    background: #355b36;

    border: 1px solid #355b36;

    color: #ffffff;

    box-shadow: 0 3px 8px rgba(53,91,54,.18);

    transition: all .2s ease;
}


.save-product-button:hover {
    background: #2c4d2e;

    border-color: #2c4d2e;
}


.save-product-button i {
    font-size: 10px;
}



/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .edit-product-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 760px) {

    .edit-product-page {
        padding: 0 5px 30px;
    }


    .edit-product-hero {
        align-items: flex-start;

        padding: 17px;

        gap: 15px;
    }


    .edit-product-hero-image {
        width: 70px;
        height: 70px;
    }


    .edit-product-hero-info h2 {
        font-size: 19px;
    }


    .edit-form-grid {
        grid-template-columns: 1fr;

        gap: 0;
    }


    .edit-section-header {
        padding: 16px;
    }


    .edit-section-body,
    .images-body,
    .new-variants-body {
        padding: 17px;
    }


    .variant-table-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }


    .new-variant-row {
        grid-template-columns: 1fr;
    }


    .remove-variant-button {
        position: absolute;

        top: 10px;
        right: 10px;
    }


    .edit-product-actions {
        flex-direction: column;
        align-items: stretch;
    }


    .edit-actions-info {
        justify-content: center;
    }


    .edit-actions-buttons {
        justify-content: stretch;
    }


    .cancel-button,
    .save-product-button {
        flex: 1;
    }

}


@media (max-width: 480px) {

    .edit-product-hero {
        flex-direction: column;
    }


    .edit-product-meta {
        gap: 5px;
    }


    .edit-product-meta > span {
        font-size: 10px;
    }


    .product-image-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}
