:root {
    --primary-color: #1a4d4d;
    /* User's choice */
    --professional-teal: #275559;
    --professional-slate: #0f172a;
    --professional-muted: #64748b;
    --text-main: #333333;
    --text-light: #666666;
    --bg-light: #f5f5f5;
    --border-color: #e0e0e0;
    --professional-border: #e2e8f0;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: #ffffff;
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
}

.product-detail-page {
    padding: 0 0 3rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: start;
}

/* Left Column: Image */
.product-image-section {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.image-card {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    display: block;
    min-height: 600px;
    height: 550px;
    overflow: hidden;
}

.image-card img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.image-card img:hover {
    transform: translateY(-10px);
}

.image-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

/* Right Column: Info Area */
.product-info-section {
    padding-top: 1rem;
}

.product-header-group {
    margin-bottom: 2rem;
}

.category-tag {
    background-color: #f0fdf4;
    color: var(--professional-teal);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 12px;
    border: 1px solid #dcfce7;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--professional-slate);
    letter-spacing: -0.02em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.unit-badge {
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 600;
    display: inline-block;
}

/* Rating Sub-section */
.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: var(--text-light);
}

.rating-val {
    font-weight: 700;
    color: var(--professional-slate);
}

.review-count {
    color: #94a3b8;
    font-weight: 500;
}

/* Price Layout Area */
.price-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
}

.current-price {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--professional-slate);
    letter-spacing: -0.01em;
}

.original-price {
    font-size: 1.3rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

.discount-badge {
    background-color: #ef4444;
    /* High urgency red */
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

.tax-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

/* Purchase Actions Section */
.action-row {
    display: flex;
    gap: 16px;
    margin-bottom: 3rem;
    align-items: center;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    height: 56px;
    padding: 4px;
    width: 140px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--professional-slate);
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.qty-btn:hover {
    background: white;
    color: var(--professional-teal);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.quantity-wrapper input {
    flex: 1;
    width: 0;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--professional-slate);
    outline: none;
}

.add-to-cart-btn {
    flex: 1;
    height: 56px;
    background-color: var(--professional-teal);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(39, 85, 89, 0.25);
}

.add-to-cart-btn:hover {
    background-color: #1a3d40;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(39, 85, 89, 0.3);
}

.add-to-cart-btn svg {
    margin-right: 12px;
    transition: transform 0.3s;
}

.add-to-cart-btn:hover svg {
    transform: translateX(-4px);
}

.wishlist-icon-btn {
    width: 56px;
    height: 56px;
    border: 1.5px solid var(--professional-border);
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.wishlist-icon-btn:hover {
    background: #fff1f2;
    border-color: #fecaca;
    color: #ef4444;
    transform: translateY(-2px);
}

.out-of-stock-btn {
    flex: 1;
    height: 56px;
    background-color: #f1f5f9;
    color: #94a3b8;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: not-allowed;
}

.divider {
    height: 1px;
    background: linear-gradient(to right, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    margin: 2.5rem 0;
}

/* Main Body Content Blocks */
.description-section h3,
.details-section h3,
.policy-section h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--professional-slate);
    letter-spacing: -0.01em;
}

.description-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4b5563;
    margin: 0;
}

/* Technical Details Information Area */
.details-table {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 16px;
    padding: 8px 24px;
    border: 1px solid var(--professional-border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--professional-border);
    font-size: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.d-label {
    color: #64748b;
    font-weight: 500;
}

.d-value {
    color: var(--professional-slate);
    font-weight: 700;
}

.text-green {
    color: #10b981;
}

.text-red {
    color: #ef4444;
}

/* Service & Quality Policies */
.policy-section {
    margin-top: 1rem;
}

.policy-item {
    display: flex;
    gap: 20px;
    margin-bottom: 1.5rem;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--professional-border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.policy-item:hover {
    border-color: var(--professional-teal);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.policy-icon {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    color: var(--professional-teal);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.policy-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--professional-slate);
    font-weight: 700;
}

.policy-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}


/* Related Products simplified */
.related-products-container {
    margin-top: 4rem;
}

.related-products-container h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.related-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.related-item {
    min-width: 200px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.related-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.r-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.r-img img {
    max-height: 100%;
    max-width: 100%;
}

.r-info h4 {
    font-size: 0.9rem;
    margin: 0 0 5px 0;
    color: #333;
}

.r-info span {
    font-weight: 700;
    color: #222;
}


@media (max-width: 768px) {
    .product-detail-page {
        padding-bottom: 80px;
        /* Spacer for fixed bottom bar */
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        /* Reduced gap */
    }

    .product-image-section {
        position: static;
        top: 0;
        margin: 0 -20px;
        /* Bleed to edges if container has padding */
        background: #f9f9f9;
        /* Optional: distinct background for image area */
        padding: 1rem 0;
    }

    .image-card {
        min-height: auto;
        height: 350px;
        /* Reduced height for mobile */
        background-color: transparent;
        border: none;
    }

    .image-card img {
        border-radius: 10px;
        object-fit: contain;
    }

    .product-info-section {
        padding-top: 0.5rem;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .rating-row {
        margin-bottom: 1rem;
    }

    /* Fixed Bottom Action Bar */
    .action-row {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 10px 15px;
        margin: 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: nowrap;
        /* Prevent wrapping */
    }

    /* Wishlist Button in Action Bar */
    .wishlist-icon-btn {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
        border: 1px solid #eee;
    }

    /* Quantity Wrapper in Action Bar */
    .quantity-wrapper {
        height: 45px;
        width: 100px;
        flex-shrink: 0;
    }

    .qty-btn {
        width: 30px;
    }

    .quantity-wrapper input {
        width: 40px;
        font-size: 0.9rem;
    }

    /* Add to Cart Button in Action Bar */
    .add-to-cart-btn {
        margin-top: 0;
        /* Remove previous margin */
        height: 45px;
        font-size: 0.95rem;
        border-radius: 6px;
        width: auto;
        flex: 1;
        /* Take remaining space */
        order: 0;
        /* Reset order if it was changed */
    }

    .out-of-stock-btn {
        height: 45px;
        margin-top: 0;
    }

    /* Adjust other sections to look better with reduced spacing */
    .policy-section {
        margin-bottom: 1rem;
    }

    .related-products-container {
        margin-top: 2rem;
    }


}

/* Quality & Trust Section */
.quality-trust-section {
    margin: 24px 0;
}

.certification-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 1.5px solid #dcfce7;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(26, 77, 77, 0.04);
}

.certification-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.certification-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(26, 77, 77, 0.08);
    border-color: var(--primary-color);
}

.cert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cert-icon {
    width: 56px;
    height: 56px;
    background: white;
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(26, 77, 77, 0.1);
}

.cert-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-body {
    flex: 1;
}

.cert-body h4 {
    margin: 0 0 6px 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
}

.cert-body p {
    margin: 0 0 12px 0;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.5;
}

.cert-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    transition: gap 0.2s;
}

.certification-card:hover .cert-cta {
    gap: 12px;
}


/* Mobile responsive for Quality section */
@media (max-width: 480px) {
    .certification-card {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .cert-header {
        align-items: center;
    }

    .cert-cta {
        width: 100%;
        justify-content: center;
        background: white;
        padding: 10px;
        border-radius: 8px;
        border: 1px solid #f0f5f2;
    }


}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    /* controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modal-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide-in {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a1a1a;
    font-weight: 700;
}

.close-modal {
    background: #f5f5f5;
    border: none;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #eeeeee;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin-top: 0;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.batch-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

.batch-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 77, 77, 0.1);
}

.error-text {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: 500;
}

.view-report-btn {
    width: 100%;
    height: 52px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-report-btn:hover {
    background-color: #143d3d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 77, 77, 0.2);
}

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

@media (max-width: 768px) {
    .modal-content {
        margin: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        max-width: none;
        animation: modal-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes modal-slide-up {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .lab-report-btn {
        height: 45px;
        font-size: 0.95rem;
        flex: 1;
        max-width: none;
    }
}

/* Spinner for buttons */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}