/* ============================================================
   PRODUCT DETAIL — Unified Coral 2025 · Pure White
============================================================ */

/* -------------------------------
   DESIGN TOKENS
---------------------------------*/
:root {
    --brand-coral: #ff7f50;
    --brand-coral-dark: #e46d4b;
    --text-primary: #333;
    --text-secondary: #888;
    --bg-light: #fafafa;
    --border-color: #ddd;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius-lg: 12px;
    --radius-md: 8px;
    --font-family: "Poppins", sans-serif;
    --success-500: #35b56f;
    --success-600: #2da562;
}

/* -------------------------------
   INPUTS
---------------------------------*/
input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: "Nunito";
    font-size: 16px; /* prevent zoom on iOS */
}

/* -------------------------------
   BREADCRUMB NAVIGATION
---------------------------------*/
.breadcrumb-nav {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

    .breadcrumb-list li {
        display: flex;
        align-items: center;
    }

        .breadcrumb-list li + li::before {
            content: "›";
            margin: 0 0.5rem;
            color: var(--text-secondary);
        }

.breadcrumb-link,
.breadcrumb-current {
    color: grey;
    font-size: 15px;
    text-decoration: none;
}

/* -------------------------------
   PAGE BASE
---------------------------------*/
.product-detail-container {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: #fff;
    padding: 1rem 1.5rem 5rem;
    box-sizing: border-box;
}

/* -------------------------------
   MAIN FLEX LAYOUT
---------------------------------*/
.product-main {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.product-image {
    flex: 1 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .product-image img {
        display: block;
        width: 400px;
        height: 400px;
        object-fit: contain;
        border-radius: var(--radius-lg);
    }

/* -------------------------------
   PRODUCT INFO
---------------------------------*/
.product-info {
    flex: 1 1 50%;
}

.medicine-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.4rem 0;
}

.product-brand {
    margin: 0.4rem 0 0.8rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.brand-link {
    color: var(--brand-coral);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* -------------------------------
   PRICING
---------------------------------*/
.price-section {
    margin: 0.8rem 0;
    font-size: 1.2rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.sale-price {
    font-weight: 600;
    font-size: 1.4rem;
}

.mrp {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.savings-bar {
    margin-top: 0.6rem;
    background: #fff2ef;
    color: var(--brand-coral-dark);
    text-align: center;
    border-radius: var(--radius-md);
    padding: 0.45rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* -------------------------------
   CART CONTROLS
---------------------------------*/
.cart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.quantity-control {
    display: flex;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    -moz-appearance: textfield;
}
    .qty-input::-webkit-inner-spin-button,
    .qty-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
.btn-add {
    background: var(--brand-coral);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

/* -------------------------------
   DELIVERY PIN CHECK
---------------------------------*/
.deliverycheckbox {
    margin-top: 1rem;
}

    .deliverycheckbox input {
        width: 50%;
        font-size: 16px;
    }

.divResult {
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* -------------------------------
   HIGHLIGHTS / INGREDIENTS / ARTICLE
---------------------------------*/
.highlights h3,
.ingredients h3,
.product-article h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand-coral-dark);
}

.highlights ul {
    padding-left: 1.2rem;
    line-height: 1.6;
    list-style-type: disc;
}

/* -------------------------------
   INGREDIENTS
---------------------------------*/
.ingredients {
    margin-top: 2rem;
}

.ingredient-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.ingredient-card {
    text-align: center;
    background: var(--bg-light);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease;
}

    .ingredient-card img {
        width: 60px;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background-color: #fff;
        border-radius: 50%;
        margin-bottom: 0.5rem;
    }

/* -------------------------------
   PRODUCT ARTICLE
---------------------------------*/
.product-article {
    margin-top: 2rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content table {
    width: 98% !important;
    border-collapse: collapse !important;
}

    .article-content table td,
    .article-content table th {
        border: 1px solid var(--border-color) !important;
        padding: 0.5rem !important;
        text-align: left !important;
    }


/* -------------------------------
   MOBILE CART FOOTER
---------------------------------*/
.mobile-cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1100;
    border-top: 1px solid #eee;
    font-family: "Poppins", sans-serif;
}

.cart-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-total {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-coral-dark);
}

.cart-footer-btn {
    background: var(--brand-coral);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 15px;
    transition: background 0.2s ease;
}

    .cart-footer-btn:hover {
        background: var(--brand-coral-dark);
    }

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-cart-footer {
        display: none !important;
    }
}

/* -------------------------------
   RESPONSIVE
---------------------------------*/
@media (max-width: 900px) {
    .product-image,
    .product-info {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .breadcrumb-nav {
        display: none;
    }
    .deliverycheckbox input {
        width: 98%;
    }

    .product-main {
        flex-direction: column;
    }

    .product-image img {
        width: 180px;
        height: 180px;
    }

    .cart-controls {
        flex-wrap: wrap;
    }

    .btn-add {
        padding: 0.8rem 0;
        font-size: 1rem;
        flex: 1;
    }

    .product-detail-container {
        padding-bottom: 6rem;
    }
}

@media (max-width: 480px) {
    .medicine-name {
        font-size: 1.1rem;
    }

    .sale-price {
        font-size: .9rem;
    }
}

/* ============================================================
   PRODUCT CAROUSEL — Unified Coral 2025 · Pure White
=========================================================== */
.product-carousel {
    width: 100%;
    margin: 2rem 0;
    background: #fff;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
}

    .product-carousel::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 80px;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(to left, rgba(255,111,97,0.12) 0%, rgba(255,111,97,0.05) 30%, rgba(255,255,255,0) 100%);
        z-index: 2;
    }

    .product-carousel::before {
        content: "";
        position: absolute;
        top: 0;
        left: 4px;
        width: 36px;
        height: 100%;
        pointer-events: none;
        z-index: 0;
        background: linear-gradient(to right, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.4) 40%, rgba(255,255,255,0) 100%);
    }

/* Header */
.product-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    margin-bottom: 14px;
}

.product-carousel-header-left {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.product-carousel-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--neutral-900);
}

.product-carousel-next-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, opacity .2s ease;
}

    .product-carousel-next-btn svg {
        fill: var(--coral-500);
    }

    .product-carousel-next-btn:focus-visible {
        outline: 2px solid var(--coral-500);
        outline-offset: 2px;
        border-radius: 6px;
    }

/* Track */
.product-carousel-track {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    gap: 2px;
    padding: 0 40px 0 48px;
    scrollbar-width: none;
    margin-left: 0;
}

    .product-carousel-track::-webkit-scrollbar {
        display: none;
    }

/* ============================================================
   PRODUCT CARD
=========================================================== */
.product-card {
    flex: 0 0 auto;
    width: 210px;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    margin-right: 0.8rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    cursor: pointer;
    margin-top: .25rem;
    margin-bottom: .25rem;
}

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

.product-card-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 1.4 / 1;
    overflow: hidden;
}

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image {
    transform: scale(1.04);
}

/* Name + price */
.product-card-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--neutral-900);
    padding: 0.4rem 0.75rem 0 0.75rem;
    line-height: 1.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.product-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    flex-wrap: wrap;
}

.product-card-mrp {
    font-size: 0.85rem;
    color: var(--neutral-600);
    text-decoration: line-through;
}

.product-card-sale {
    font-size: 0.95rem;
    color: var(--coral-600);
    font-weight: 600;
}

.product-card-discount {
    font-size: 0.8rem;
    color: var(--coral-500);
    font-weight: 600;
}

/* Actions */
.product-card-actions {
    padding: 0.6rem 0.75rem 0.9rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.product-card-qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.product-card-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 1.1rem;
    line-height: 26px;
    color: var(--neutral-900);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
    box-sizing: border-box;
}

    .product-card-qty-btn:hover {
        background: var(--coral-500);
        color: #fff;
        border-color: var(--coral-500);
    }

.product-card-qty-input {
    width: 34px;
    height: 28px;
    min-width: 110px;
    line-height: 26px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--neutral-900);
    background: #fff;
    box-sizing: border-box;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.product-card-add-btn {
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: var(--coral-500);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.25s ease;
}

    .product-card-add-btn:hover {
        background: var(--coral-600);
    }

    .product-card-add-btn.added {
        background: var(--success-500) !important;
        transform: scale(1.03);
        animation: productCardAddedPulse 1.2s ease;
    }

@keyframes productCardAddedPulse {
    0% {
        box-shadow: 0 0 0 rgba(53,181,111,0);
    }

    30% {
        box-shadow: 0 0 10px rgba(53,181,111,0.4);
    }

    100% {
        box-shadow: 0 0 0 rgba(53,181,111,0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .product-carousel-next-btn {
        display: none !important;
    }

    .product-carousel-track {
        padding: 0 16px !important;
    }

    .product-card {
        width: 42%;
        margin-right: 0.5rem;
    }

    .product-card-mrp {
        font-size: 0.55rem;
    }

    .product-card-sale {
        font-size: 0.65rem;
    }

    .product-card-discount {
        font-size: 0.6rem;
    }

    .product-card-qty-btn,
    .product-card-qty-input {
        height: 32px;
        line-height: 30px;
    }

    .product-card-qty-btn {
        font-size: 1.2rem;
    }

    .product-card-qty-input {
        font-size: 1rem;
        min-width:10px;
    }
}

/* Touch highlight fix */
.product-card,
.product-card * {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
}
