/* =========================================================
   Product Page – Styles
   ========================================================= */

/* ---- Layout ---- */
section#content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 8%;
    gap: 32px;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Breadcrumb ---- */
#ariane {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

#ariane a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(0, 0, 0, 0.55);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

#ariane a:hover {
    color: #4F7F34;
}

#ariane span {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
}

#ariane .ariane-current {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#ariane .icon.home-icon {
    background-color: rgba(0, 0, 0, 0.55);
    width: 14px;
    height: 14px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
}

/* ---- Product Content Row ---- */
#product_content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
}

/* ---- Gallery ---- */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 48%;
    flex-shrink: 0;
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

#main_image {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: contain;
    display: block;
    border: 2px solid #4F7F34;
    border-radius: 16px;
    transition: opacity 0.25s ease;
}

#main_image.loading {
    opacity: 0.4;
}

/* Thumbnails */
.product-thumbnails {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.thumbnail-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    width: calc(25% - 6px);
    aspect-ratio: 1/1;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.thumbnail-btn:hover {
    border-color: #4F7F34;
    transform: scale(1.04);
    box-shadow: 0 3px 10px rgba(79,127,52,0.25);
}

.thumbnail-btn.active {
    border-color: #4F7F34;
    box-shadow: 0 0 0 3px rgba(79,127,52,0.3);
}

/* ---- Product Info ---- */
#product_informations {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

#product_title {
    font-size: clamp(22px, 3vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    color: #111;
    margin: 0;
}

.product_separator {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4F7F34 0%, rgba(79,127,52,0.2) 100%);
    border-radius: 10px;
}

/* Prices */
#prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#price {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    color: #4F7F34;
    line-height: 1;
    letter-spacing: -0.5px;
}

#delivery_charges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #444;
    background: #f0f7ea;
    border-radius: 8px;
    padding: 6px 12px;
    width: fit-content;
}

#delivery_charges svg {
    flex-shrink: 0;
    color: #4F7F34;
}

#delivery_charges strong {
    color: #2d6a1a;
}

/* Description */
#product_description {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin: 0;
    white-space: pre-line;
}

/* CTA block */
#cta-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #4F7F34;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(79,127,52,0.35);
}

.btn-cta:hover {
    background: #6a9e48;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,127,52,0.45);
}

.btn-cta:active {
    transform: translateY(0);
}

.btn-back {
    font-size: 13px;
    color: #4F7F34;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #5a8f3a;
    text-decoration: underline;
}

.product-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f7f4;
    border: 1px solid #dce8d4;
    border-radius: 10px;
    padding: 8px 10px;
}

.product-qty label {
    font-size: 13px;
    font-weight: 600;
    color: #2d6a1a;
}

.product-qty input {
    width: 72px;
    height: 36px;
    border: 1.5px solid #c7d8ba;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    background: #fff;
}

/* =========================================================
   Variants Section
   ========================================================= */
.product-variants {
    width: 100%;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    padding: 28px;
    box-sizing: border-box;
}

.product-variants h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px 0;
}

.product-variants h2 svg {
    color: #4F7F34;
    flex-shrink: 0;
}

.variants-count {
    background: #4F7F34;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.6;
}

.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.variant-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.variant-card:hover {
    border-color: #4F7F34;
    box-shadow: 0 6px 20px rgba(79,127,52,0.2);
    transform: translateY(-3px);
}

.variant-img-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
}

.variant-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.variant-card:hover .variant-img-wrapper img {
    transform: scale(1.05);
}

.variant-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 12px;
}

.variant-name {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.variant-price {
    font-size: 14px;
    font-weight: 700;
    color: #4F7F34;
}

/* =========================================================
   Responsive – Tablet (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {
    section#content {
        padding: 24px 5%;
        gap: 24px;
    }

    #product_content {
        flex-direction: column;
        gap: 24px;
    }

    .product-gallery {
        width: 100%;
    }

    .thumbnail-btn {
        width: calc(20% - 7px);
    }

    #product_title {
        font-size: 26px;
    }

    .variants-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* =========================================================
   Responsive – Mobile (≤ 576px)
   ========================================================= */
@media (max-width: 576px) {
    section#content {
        padding: 16px 4%;
        gap: 20px;
    }

    #ariane .ariane-current {
        max-width: 180px;
    }

    .thumbnail-btn {
        width: calc(25% - 6px);
    }

    #price {
        font-size: 32px;
    }

    .btn-cta {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .product-qty {
        width: 100%;
        justify-content: space-between;
    }

    .product-qty input {
        width: 90px;
    }

    .btn-back {
        width: 100%;
        text-align: center;
    }

    .product-variants {
        padding: 18px 14px;
    }

    .product-variants h2 {
        font-size: 17px;
    }

    .variants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .variant-name {
        font-size: 11px;
    }
}
