/* --- Premium CSS Design System --- */
:root {
    /* Color Palette */
    --primary-hue: 220;
    --primary-color: hsl(var(--primary-hue), 90%, 50%);
    --primary-light: hsl(var(--primary-hue), 95%, 95%);
    --primary-dark: hsl(var(--primary-hue), 90%, 40%);
    
    --success-hue: 150;
    --success-color: hsl(var(--success-hue), 80%, 38%);
    --success-light: hsl(var(--success-hue), 80%, 95%);
    
    --warning-hue: 35;
    --warning-color: hsl(var(--warning-hue), 95%, 45%);
    
    --danger-hue: 0;
    --danger-color: hsl(var(--danger-hue), 85%, 55%);
    --danger-light: hsl(var(--danger-hue), 85%, 95%);

    --neutral-dark: hsl(220, 15%, 15%);
    --neutral-light: hsl(220, 20%, 97%);
    --neutral-medium: hsl(220, 10%, 60%);
    --border-color: hsl(220, 12%, 90%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-app: hsl(220, 20%, 98%);
    
    /* Glassmorphism settings */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(16px);
    
    /* Spacing & Borders */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-circle: 50%;
    --transition-speed: 0.3s;
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* --- Global Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--neutral-dark);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for bottom nav */
}

.icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    transition: transform var(--transition-speed);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}
/* --- Header Styling --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 70%;
}

.location-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-lg);
    background: rgba(0, 0, 0, 0.03);
    transition: background var(--transition-speed);
}

.location-trigger:hover {
    background: rgba(0, 0, 0, 0.06);
}

.location-trigger .icon-pin {
    color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.location-trigger .icon-chevron-down {
    color: var(--neutral-medium);
    width: 14px;
    height: 14px;
}

.location-info {
    display: flex;
    flex-direction: column;
}

.location-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-dark);
}

.location-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.brand-container {
    display: none; /* Hidden on mobile header to save space, visible on large views */
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-dark);
    transition: background var(--transition-speed), transform var(--transition-speed);
}

.header-action-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.header-action-btn:active {
    transform: scale(0.95);
}

.header-action-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.header-profile-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-circle);
    overflow: hidden;
    border: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-speed);
}

.header-profile-btn:active {
    transform: scale(0.95);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Sticky Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 98;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--neutral-medium);
    gap: 3px;
    width: 25%;
    height: 100%;
    transition: color var(--transition-speed);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-speed);
}

.nav-item:active .nav-icon {
    transform: scale(0.9);
}

.nav-text {
    font-size: 10px;
    font-weight: 700;
}

.cart-icon-wrapper {
    position: relative;
}

.cart-count-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--bg-card);
}
/* --- Slide-down Search Panel --- */
.search-slide-panel {
    position: fixed;
    top: 68px;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    z-index: 99;
    box-shadow: var(--shadow-md);
    transition: max-height var(--transition-speed) ease-in-out, padding var(--transition-speed) ease-in-out;
}

.search-slide-panel.open {
    max-height: 70px;
    padding: 12px 16px;
}

.search-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--neutral-medium);
}

.search-container input {
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    padding: 0 44px;
    font-size: 14px;
    font-family: inherit;
    color: var(--neutral-dark);
    outline: none;
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.search-container input:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    width: 20px;
    height: 20px;
    color: var(--neutral-medium);
    display: none;
    align-items: center;
    justify-content: center;
}

.search-clear-btn.visible {
    display: flex;
}

.search-clear-btn svg {
    width: 16px;
    height: 16px;
}
/* --- Main Content Section --- */
.main-content {
    margin-top: 80px;
    padding: 0 16px;
}

.promo-banner {
    background: linear-gradient(135deg, hsl(220, 90%, 94%), hsl(220, 90%, 98%));
    border: 1px solid var(--primary-light);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-banner h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.promo-banner p {
    font-size: 13px;
    color: var(--neutral-medium);
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

/* --- Product Grid & Cards --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--transition-speed), opacity 0.5s ease;
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Image Container */
.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--neutral-light);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform var(--transition-speed) var(--transition-bounce);
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Bookmark/Save Icon */
.product-save-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-circle);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-medium);
    box-shadow: var(--shadow-sm);
    z-index: 2;
    transition: color var(--transition-speed), background var(--transition-speed), transform var(--transition-speed);
}

.product-save-btn:hover {
    color: var(--primary-color);
}

.product-save-btn.saved {
    color: var(--primary-color);
    background: var(--primary-light);
}

.product-save-btn:active {
    transform: scale(0.9);
}

/* Promo Tag Badge */
.product-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-dark);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 8px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom-right-radius: var(--border-radius-sm);
    z-index: 2;
}

/* Action Button overlay (bottom right) */
.product-action-container {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
}

.add-btn-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-circle);
    background: white;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
}

.add-btn-circle:hover {
    background: var(--primary-color);
    color: white;
}

.add-btn-circle:active {
    transform: scale(0.9);
}

.add-btn-circle svg {
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

/* Quantity Selector Inline */
.qty-selector-card {
    background: var(--primary-light);
    border: 1.5px solid var(--primary-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 4px;
    min-width: 80px;
    box-shadow: var(--shadow-md);
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--border-radius-circle);
    color: var(--primary-color);
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-speed);
}

.qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.qty-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 6px;
}

/* Product Info Container */
.product-info-box {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--neutral-medium);
    margin-bottom: 6px;
    font-weight: 600;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--success-color);
}

.rating-star-icon {
    width: 12px;
    height: 12px;
    fill: var(--success-color);
}

.meta-divider {
    color: var(--border-color);
}

.product-title-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--neutral-dark);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
}

.product-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    min-height: 20px;
}

.pill-outline {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
}

.pill-solid-blue {
    font-size: 10px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.pill-solid-blue::before {
    content: "▲";
    font-size: 8px;
}

.product-pricing-box {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.price-drop-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.discount-percentage {
    font-size: 11px;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 2px;
}

.price-numbers {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.current-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--neutral-dark);
}

.original-price {
    font-size: 12px;
    text-decoration: line-through;
    color: var(--neutral-medium);
}
/* --- Fullscreen Product Details Popup / Modal --- */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-app);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

.product-modal.open {
    transform: translateY(0);
}

/* Modal Header */
.modal-header {
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.modal-back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-dark);
}

.modal-back-btn svg {
    width: 24px;
    height: 24px;
}

.modal-title-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--neutral-dark);
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-circle);
    background: var(--neutral-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-dark);
    transition: color var(--transition-speed);
}

.modal-action-btn svg {
    width: 18px;
    height: 18px;
}

.modal-action-btn.saved {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Modal Body */
.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
}

/* Image Slider Component */
.image-slider-container {
    width: 100%;
    background-color: var(--neutral-light);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.1 / 1;
    border-bottom: 1px solid var(--border-color);
}

.image-slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE/Edge */
    scrollbar-width: none;  /* Firefox */
}

.image-slider-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.slider-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-slide img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--border-radius-circle);
    background: rgba(0, 0, 0, 0.2);
    transition: background-color var(--transition-speed), width var(--transition-speed);
}

.slider-dot.active {
    background: var(--primary-color);
    width: 18px;
    border-radius: 4px;
}

/* Product Main Details card */
.modal-detail-card {
    background: var(--bg-card);
    padding: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-explore-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.brand-explore-link:hover {
    color: var(--primary-dark);
}

.brand-explore-link::after {
    content: ">";
    font-weight: 800;
}

.modal-product-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--neutral-dark);
    line-height: 1.4;
    margin-bottom: 4px;
}

.modal-product-subtitle {
    font-size: 14px;
    color: var(--neutral-medium);
    margin-bottom: 6px;
}

.modal-product-unit {
    font-size: 13px;
    color: var(--neutral-medium);
    margin-bottom: 16px;
}

/* Discount indicator line */
.modal-discount-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-discount-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-discount-divider {
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

/* Price & Buy Action Row */
.modal-purchase-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-price-box {
    display: flex;
    flex-direction: column;
}

.modal-current-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--neutral-dark);
}

.modal-original-price {
    font-size: 14px;
    text-decoration: line-through;
    color: var(--neutral-medium);
}

.modal-buy-container {
    width: 120px;
}

.modal-add-btn {
    width: 100%;
    height: 40px;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: background var(--transition-speed), transform var(--transition-speed);
}

.modal-add-btn:hover {
    background: var(--primary-dark);
}

.modal-add-btn:active {
    transform: scale(0.95);
}

/* Quantity selector on details popup */
.modal-qty-selector {
    background: var(--primary-light);
    border: 1.5px solid var(--primary-color);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 8px;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

/* Specifications Table Block */
.modal-specs-block {
    background: var(--bg-card);
    padding: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.specs-table tr {
    border-bottom: 1px solid var(--border-color);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 12px;
    font-size: 13px;
}

.specs-table td.label-col {
    width: 35%;
    font-weight: 600;
    color: var(--neutral-medium);
    background-color: var(--neutral-light);
    border-right: 1px solid var(--border-color);
}

.specs-table td.value-col {
    color: var(--neutral-dark);
    font-weight: 500;
}

/* Accordion Component */
.modal-accordion {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1px;
}

.accordion-header {
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--neutral-dark);
    transition: background var(--transition-speed);
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.01);
}

.accordion-arrow {
    width: 18px;
    height: 18px;
    color: var(--neutral-medium);
    transition: transform var(--transition-speed);
}

.modal-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease-out;
}

.modal-accordion.open .accordion-content-wrapper {
    max-height: 500px; /* arbitrary large height for expand */
}

.accordion-content {
    padding: 0 16px 16px 16px;
    font-size: 13px;
    color: var(--neutral-medium);
    line-height: 1.6;
}

.show-less-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    font-size: 12px;
}

.show-less-link:hover {
    text-decoration: underline;
}

/* --- Location Modal --- */
.location-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1100;
    display: none;
    align-items: flex-end; /* Slides from bottom */
}

.location-modal.open {
    display: flex;
    animation: fadeInOverlay 0.3s forwards;
}

.location-modal-content {
    width: 100%;
    background: var(--bg-card);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.location-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.location-modal-header h3 {
    font-size: 16px;
    font-weight: 800;
}

.close-location-btn {
    font-size: 24px;
    color: var(--neutral-medium);
}

.location-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    cursor: pointer;
    transition: border-color var(--transition-speed), background var(--transition-speed);
}

.location-item:hover {
    background-color: var(--neutral-light);
}

.location-item.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.location-item h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--neutral-dark);
}

.location-item p {
    font-size: 12px;
    color: var(--neutral-medium);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 320px;
}

.toast {
    background: var(--neutral-dark);
    color: white;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInOut 2.5s forwards;
}

/* --- Skeletons & Keyframes --- */
.grid-skeleton {
    display: contents;
}

.skeleton-card {
    height: 220px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius-md);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); }
    15% { opacity: 1; transform: translateY(0) scale(1.05); }
    22% { transform: translateY(0) scale(1); }
    85% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-15px) scale(0.9); }
}

@keyframes fadeInOverlay {
    from { background: rgba(0, 0, 0, 0); }
    to { background: rgba(0, 0, 0, 0.5); }
}

.qty-val.pop {
    animation: textPop 0.2s ease-out;
}

@keyframes textPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
/* --- Profile Drawer Styling --- */
.profile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #f7f9fa; /* Sleek light-grey page background matching screenshot */
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}

.profile-drawer.open {
    transform: translateX(0);
}

/* Header */
.profile-drawer-header {
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    flex-shrink: 0;
}

.profile-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-dark);
    transition: background var(--transition-speed);
}

.profile-close-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.profile-close-btn svg {
    width: 24px;
    height: 24px;
}

.profile-header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--neutral-dark);
}

/* Body */
.profile-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 16px;
    -webkit-overflow-scrolling: touch;
}

/* User Card Component */
.profile-user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.profile-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-circle);
    background: #e4e6eb;
    color: var(--neutral-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-user-avatar svg {
    width: 36px;
    height: 36px;
}

.profile-user-name-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
}

.profile-user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--neutral-dark);
    border-bottom: 1px dashed var(--neutral-medium);
    padding-bottom: 2px;
}

.profile-name-edit-btn {
    color: var(--neutral-medium);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-circle);
    transition: color var(--transition-speed), background var(--transition-speed);
}

.profile-name-edit-btn:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.04);
}

.profile-name-edit-btn svg {
    width: 18px;
    height: 18px;
}

/* Section Dividers */
.profile-section {
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--neutral-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-left: 4px;
}

/* Menu Items List */
.profile-menu-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background-color: var(--neutral-light);
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--neutral-dark);
}

.menu-icon {
    width: 22px;
    height: 22px;
    color: var(--neutral-medium);
}

.menu-icon.icon-categories {
    color: #4b6ef5;
}

.menu-icon.icon-bookings {
    color: var(--success-color);
}

.menu-icon.icon-saved {
    color: #f59e0b;
}

.menu-icon.icon-cart {
    color: #ec4899;
}

.chevron-right {
    width: 16px;
    height: 16px;
    color: var(--neutral-medium);
    transition: transform var(--transition-speed);
}

.profile-menu-item:hover .chevron-right {
    transform: translateX(3px);
}

/* Refer Card */
.refer-earn-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-speed);
}

.refer-earn-card:hover {
    background-color: var(--neutral-light);
}

.refer-earn-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--neutral-dark);
    margin-bottom: 4px;
}

.refer-earn-info p {
    font-size: 12px;
    color: var(--neutral-medium);
}

/* --- Staggered Slide In Animations for Drawer Contents --- */
.profile-drawer.open .profile-user-card {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    animation-delay: 0.05s;
}

.profile-drawer.open .profile-section {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.profile-drawer.open .profile-section:nth-of-type(1) { animation-delay: 0.1s; }
.profile-drawer.open .profile-section:nth-of-type(2) { animation-delay: 0.15s; }
.profile-drawer.open .profile-section:nth-of-type(3) { animation-delay: 0.2s; }

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* --- Desktop Adaptations --- */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
        background-color: #f3f4f6;
    }
    
    .main-header {
        padding: 0 40px;
    }
    
    .brand-container {
        display: block;
    }
    
    .main-content {
        max-width: 1024px;
        margin: 100px auto 40px auto;
        background: white;
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-md);
        padding: 40px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .bottom-nav {
        display: none; /* Hide mobile nav on desktop */
    }
    
    /* Adapt product details modal to look like a centered lightbox dialog */
    .product-modal {
        top: 5%;
        left: 50%;
        width: 600px;
        height: 90%;
        transform: translate(-50%, 100%);
        border-radius: 28px;
        overflow: hidden; /* Clips top header and body to the curves */
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
        opacity: 0;
        pointer-events: none;
    }

    
    .product-modal.open {
        transform: translate(-50%, 0);
        opacity: 1;
        pointer-events: all;
    }
    
    .location-modal-content {
        max-width: 480px;
        margin: 0 auto;
        border-radius: var(--border-radius-lg);
    }
    
    .location-modal {
        align-items: center; /* Center location modal on desktop */
    }
}
/* --- Checkout & Confirmation Screens --- */
.screen-checkout, .screen-confirmation { padding: 20px; max-width: 600px; margin: 0 auto; }
.checkout-form-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--neutral-medium); }
.form-input { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); font-family: inherit; font-size: 15px; background: var(--bg-card); color: var(--neutral-dark); outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--primary-color); }
.order-summary-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.order-item-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.order-item-row:last-child { border-bottom: none; }
.order-total-row { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; padding-top: 12px; margin-top: 4px; border-top: 2px solid var(--border-color); }
.btn-primary-full { width: 100%; padding: 16px; background: var(--primary-color); color: white; border: none; border-radius: var(--border-radius-sm); font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.btn-primary-full:hover { background: var(--primary-dark); }
.btn-primary-full:active { transform: scale(0.98); }
.btn-primary-full:disabled { opacity: 0.6; cursor: not-allowed; }
.ticket-id-box { background: var(--primary-light); border: 2px dashed var(--primary-color); border-radius: var(--border-radius-md); padding: 24px; text-align: center; margin: 20px 0; }
.ticket-id-label { font-size: 12px; font-weight: 700; color: var(--primary-color); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.ticket-id-number { font-size: 28px; font-weight: 800; color: var(--primary-dark); letter-spacing: 2px; }
.cart-item-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 16px; margin-bottom: 12px; display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow-sm); }
.cart-item-img { width: 72px; height: 72px; border-radius: var(--border-radius-sm); object-fit: contain; background: var(--neutral-light); flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-fabric { font-size: 11px; color: var(--neutral-medium); margin-bottom: 8px; }
.cart-item-price { font-size: 16px; font-weight: 800; color: var(--neutral-dark); }
.cart-item-mrp { font-size: 12px; text-decoration: line-through; color: var(--neutral-medium); margin-left: 6px; }
.category-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.category-tab-btn { flex-shrink: 0; padding: 8px 20px; border-radius: var(--border-radius-lg); font-size: 13px; font-weight: 700; border: 1.5px solid var(--border-color); background: var(--bg-card); color: var(--neutral-medium); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.category-tab-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.fabric-tag { display: inline-block; font-size: 10px; font-weight: 600; color: var(--neutral-medium); background: var(--neutral-light); border: 1px solid var(--border-color); padding: 2px 6px; border-radius: 4px; margin-bottom: 4px; }
.category-badge { display: inline-block; font-size: 9px; font-weight: 800; color: var(--primary-dark); background: var(--primary-light); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
/* Empty cart state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--neutral-medium); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--neutral-dark); }
.empty-state p { font-size: 14px; }
/* Checkout screen header */
.screen-header { height: 56px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 50; }
.screen-header h2 { font-size: 16px; font-weight: 800; }
/* Discount calc badge on cards */
.discount-badge-pill { font-size: 10px; font-weight: 800; color: var(--success-color); background: var(--success-light); padding: 2px 6px; border-radius: 4px; }
