/* ============================================
   LAYOUT SYSTEM - PRODUCTION READY
   Consistent, responsive layout for all product sections
   ============================================ */

/* === CSS Variables === */
:root {
    --container: 1200px;
    --gap: 28px;
    --purple-primary: #7c3aed;
    --purple-dark: #6d28d9;
    --purple-chip: #5b21b6;
    --purple-chip-bg: #ede9fe;
    --gold-star: #FFC107;
    --gray-text: #6b7280;
    --gray-light: #f9fafb;
    --gray-border: #9ca3af;
}

/* === Global Reset === */
* {
    box-sizing: border-box;
}

/* === Layout Container === */
/* IMPORTANT: Exclude header .container to avoid navbar logo positioning issues */
main .container,
section .container,
.container:not(header .container) {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 16px;
    box-sizing: border-box;
}

/* Ensure header container uses its own styles from navbar CSS */
header .container {
    /* Styles defined in navbar-modern-clean.css and styles.css */
}

/* === Section Layout === */
.section {
    padding-block: 48px;
}

.section--alt {
    background: var(--gray-light);
}

.section__head {
    text-align: center;
    margin-bottom: 24px;
}

.section__title {
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 900;
    color: #111;
    margin: 0;
}

.section__sub {
    color: var(--gray-text);
    margin: 8px 0 0;
    font-size: 16px;
    line-height: 1.6;
}

/* === Card Grid - Responsive, Equal Height === */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
    align-items: stretch; /* All cards same height */
    justify-content: center;
}

/* === Card Primitives === */
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 10px 40px rgba(116, 84, 255, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(116, 84, 255, 0.15);
}

/* === Card Media === */
.card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.card:hover .card__media img {
    transform: scale(1.05);
}

/* === Card Body === */
.card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    flex: 1;
}

.card__title {
    color: #111;
    font-weight: 800;
    line-height: 1.2;
    font-size: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
    margin: 0;
}

.card__meta {
    color: var(--gray-text);
    font-size: 14px;
    line-height: 1.5;
}

/* === Card Price === */
.card__price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price--mrp {
    color: var(--gray-border);
    text-decoration: line-through;
    font-size: 16px;
}

.price--sale {
    font-size: 26px;
    font-weight: 900;
    color: var(--purple-dark);
}

/* === Chips / Badges === */
.chip {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chip--plan {
    background: var(--purple-chip-bg);
    color: var(--purple-chip);
}

.chip--discount {
    background: #dcfce7;
    color: #16a34a;
}

/* === Discount Badge (on media) === */
.card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    z-index: 1;
}

/* === WhatsApp Icon (optional) === */
.card__whatsapp {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.card__whatsapp:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

/* === Rating Stars === */
.card__rating {
    display: flex;
    gap: 4px;
    color: var(--gold-star);
    font-size: 14px;
}

/* === CTA - Bottom Aligned === */
.cta {
    margin-top: auto; /* Pins button row to the bottom */
}

.btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: var(--purple-primary);
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    border: 0;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.25);
}

/* === Cart Bug Guard === */
.cart {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin-left: auto;
}

/* Removed .navbar styles - handled by navbar-modern-clean.css */

/* === Prevent Stray Margins === */
main > * {
    margin-block: 0;
}

/* === Responsive Grid Adjustments === */
@media (min-width: 640px) and (max-width: 1023px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile adjustments */
@media (max-width: 639px) {
    .section {
        padding-block: 32px;
    }

    .section__title {
        font-size: 24px;
    }

    .section__sub {
        font-size: 14px;
    }

    .cards {
        gap: 20px;
    }
}
