/* ============================================
   UNDERSOFA - MODERN GLASSMORPHISM DESIGN
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --dark-color: #2c3e50;
    --light-color: #f7f7f7;
    --gold: #ffd700;
    --purple-dark: #667eea;
    --purple-light: #764ba2;
    --glass-bg: rgba(255,255,255,0.1);
    --glass-border: rgba(255,255,255,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* make media elements fluid so cards don't stretch them */
img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background: #3b3f70;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* fixed background can break rendering on iOS/Safari (white/yellow pages on scroll) */
    background-attachment: scroll;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: #3b3f70;
    color: var(--light-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Enable fixed attachment only on larger desktop-like environments */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
    body {
        background-attachment: fixed;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><path d="M10,50 Q30,30 50,50 T90,50" stroke="white" fill="none" stroke-width="2"/><circle cx="20" cy="40" r="2" fill="white"/><circle cx="80" cy="60" r="2" fill="white"/></svg>');
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    position: relative;
    z-index: 100;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--light-color), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s;
}

.navbar-brand a:hover {
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-menu a {
    color: var(--light-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.navbar-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s;
}

.navbar-menu a:hover::before,
.navbar-menu a.active::before {
    width: 100%;
}

.navbar-menu a:hover {
    color: var(--gold);
}

.cart-menu {
    position: relative;
}

.cart-badge {
    background: var(--gold);
    color: var(--dark-color);
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    font-weight: 700;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    min-height: calc(100vh - 200px);
}

/* Fallback for browsers without backdrop-filter support */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .navbar,
    .product-card,
    .catalog-header,
    .empty-state,
    .product-detail,
    .main-image,
    .cart-item,
    .cart-summary,
    .checkout-form,
    .checkout-summary,
    .order-details,
    .payment-section,
    .footer {
        background: rgba(29, 33, 64, 0.88) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.floating-items {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-items span {
    position: absolute;
    font-size: 3rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.3;
}

.floating-items span:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-items span:nth-child(2) { top: 70%; left: 80%; animation-delay: 1s; }
.floating-items span:nth-child(3) { top: 30%; left: 70%; animation-delay: 2s; }
.floating-items span:nth-child(4) { top: 80%; left: 20%; animation-delay: 3s; }
.floating-items span:nth-child(5) { top: 20%; left: 85%; animation-delay: 4s; }
.floating-items span:nth-child(6) { top: 60%; left: 15%; animation-delay: 5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: 2rem;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    font-weight: 900;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,0,0,0.75),
                -0.025em -0.05em 0 rgba(0,255,0,0.75),
                0.025em 0.05em 0 rgba(0,0,255,0.75);
    animation: glitch 500ms infinite;
    line-height: 1.1;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255,0,0,0.75),
                    -0.05em -0.025em 0 rgba(0,255,0,0.75),
                    -0.025em 0.05em 0 rgba(0,0,255,0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255,0,0,0.75),
                    -0.05em -0.025em 0 rgba(0,255,0,0.75),
                    -0.025em 0.05em 0 rgba(0,0,255,0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75),
                    0.025em 0.025em 0 rgba(0,255,0,0.75),
                    -0.05em -0.05em 0 rgba(0,0,255,0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75),
                    0.025em 0.025em 0 rgba(0,255,0,0.75),
                    -0.05em -0.05em 0 rgba(0,0,255,0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75),
                    0.05em 0 0 rgba(0,255,0,0.75),
                    0 -0.05em 0 rgba(0,0,255,0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75),
                    0.05em 0 0 rgba(0,255,0,0.75),
                    0 -0.05em 0 rgba(0,0,255,0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255,0,0,0.75),
                    -0.025em -0.025em 0 rgba(0,255,0,0.75),
                    -0.025em -0.05em 0 rgba(0,0,255,0.75);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.5rem;
    margin: 1rem 0;
    color: var(--gold);
    text-transform: uppercase;
}

.hero-description {
    max-width: 600px;
    margin: 2rem auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

.hero-content p {
    margin: 0.5rem 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gold);
    color: var(--dark-color);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--light-color);
    border: 2px solid var(--light-color);
}

.btn-outline:hover {
    background: var(--light-color);
    color: var(--dark-color);
    border-color: var(--light-color);
}

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-search {
    background: var(--gold);
    color: var(--dark-color);
    border: none;
    font-weight: 700;
}

.btn-search:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */

.featured-products,
.about {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.featured-products h2,
.about h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gold), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--light-color);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center; /* center cards when row isn't full */
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    max-width: 320px; /* prevent cards from becoming too wide */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* remove fixed aspect-ratio so card height follows content */
    min-height: 0;
    cursor: pointer;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gold) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-10px) rotate(1deg);
    border-color: var(--gold);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.product-card:hover::before {
    opacity: 0.1;
}

.product-image {
    width: 100%;
    position: relative;
    min-height: 180px; /* ensure some space while image loads */
    margin-bottom: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    animation: float 3s ease-in-out infinite;
}

/* if image hasn't loaded yet the float animation might collapse container; ensure maintain shape */
.product-image:empty {
    background: var(--glass-bg);
}

/* absolutely position image and fade it in once loaded */
.product-image img {
    position: relative;
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}
.product-image img.loaded {
    opacity: 1;
}
.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-weight: 700;
}

.product-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
}

.product-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;      /* let buttons drop to new line if space is tight */
}

.product-buttons .btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    min-width: 0;        /* permit shrinking below content width */
    white-space: nowrap; /* prevent text wrapping inside button */
    cursor: pointer;     /* override card pointer when hovering over button */
}

.product-buttons .btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
}

.section-footer {
    text-align: center;
    margin-top: 2rem;
}

/* ============================================
   CATALOG HEADER
   ============================================ */

.catalog-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 1rem;
    margin-bottom: 2rem;
    margin: 2rem 5%;
    max-width: 1400px;
}

.catalog-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--gold), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: var(--light-color);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px dashed var(--glass-border);
    margin: 2rem 5%;
    max-width: 1400px;
}

.empty-message {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.empty-description {
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--gold);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
}

.back-link:hover {
    transform: translateX(-5px);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.main-image:hover img {
    transform: scale(1.05);
}

.thumbnail-gallery {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
    object-fit: cover;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.product-details h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 900;
}

.product-meta {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.price-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border-left: 4px solid var(--gold);
}

.price-big {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold);
}

.description {
    margin-bottom: 2rem;
}

.description h3 {
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 700;
}

.description p {
    line-height: 1.8;
    opacity: 0.9;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--light-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 1rem;
}

.qty-btn:hover {
    background: var(--gold);
    color: var(--dark-color);
}

.qty-input {
    width: 60px;
    border: none;
    text-align: center;
    font-weight: 600;
    color: var(--light-color);
    background: transparent;
    font-size: 1rem;
}

.qty-input:focus {
    outline: none;
}

/* ============================================
   CART PAGE
   ============================================ */

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto 40px;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.cart-item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--gold);
    font-weight: 700;
}

.item-price {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.quantity-control .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--light-color);
}

.item-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gold);
    text-align: right;
    min-width: 80px;
}

.btn-remove {
    width: 40px;
    height: 40px;
    border: 2px solid #ff6b6b;
    background: transparent;
    color: #ff6b6b;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 1.2rem;
}

.btn-remove:hover {
    background: #ff6b6b;
    color: var(--light-color);
    transform: rotate(90deg) scale(1.1);
}

.cart-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: var(--light-color);
}

.summary-row.total {
    border-bottom: none;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gold);
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.checkout-form {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.checkout-form h2 {
    margin-bottom: 1.5rem;
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gold);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--light-color);
    transition: all 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.checkout-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.checkout-summary h2 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.order-items {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: rgba(255,255,255,0.8);
}

.order-total {
    background: rgba(255, 215, 0, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--gold);
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gold);
}

.total-amount {
    font-size: 1.5rem;
}

/* ============================================
   ORDER CONFIRMATION
   ============================================ */

.confirmation-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 5%;
}

.confirmation-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.order-details {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.order-details h2 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.detail-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 700;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: rgba(255,255,255,0.8);
}

.detail-row .label {
    color: var(--light-color);
    font-weight: 600;
}

.detail-section.total {
    border: none;
    background: rgba(255, 215, 0, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--gold);
    margin-top: 1rem;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold);
}

.payment-section {
    background: rgba(255, 215, 0, 0.1);
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid var(--gold);
}

.payment-section h2 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.payment-box {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.payment-box p {
    margin: 0;
    font-weight: 600;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--gold);
}

.payment-note {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 1rem 0;
}

.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 3rem 5%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    margin: 0.5rem 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.feature {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--gold);
    background: rgba(255, 215, 0, 0.15);
    color: var(--light-color);
}

.alert-info {
    background: rgba(255, 215, 0, 0.15);
    border-left-color: var(--gold);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cart-container,
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .cart-summary,
    .checkout-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .featured-products h2,
    .about h2 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .search-form {
        flex-direction: column;
    }

    .cart-item {
        grid-template-columns: 60px 1fr auto;
        gap: 0.75rem;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .product-buttons {
        flex-direction: column;
    }

    .product-buttons .btn {
        width: 100%;
    }

    .actions {
        flex-direction: column;
    }

    .quantity-selector {
        width: 100%;
    }

    .navbar-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-detail {
        padding: 1rem;
    }

    .product-details h1 {
        font-size: 1.6rem;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cart-item-image {
        width: 100%;
        height: 200px;
    }

    .container {
        padding: 1rem 5%;
    }

    /* decrease space on product card buttons on tiny screens */
    .product-buttons .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   NAVBAR MOBILE - HAMBURGER COLLAPSE
   Replace horizontal scroll with accessible collapsible menu
   ============================================ */

/* toggle button (hidden by default) */
.navbar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--light-color);
    font-size: 1.4rem;
    padding: 0.5rem;
    cursor: pointer;
}

@media (max-width: 480px) {
    .navbar-container {
        padding-left: 4% !important;
        padding-right: 4% !important;
    }

    .navbar-brand a {
        font-size: 1.4rem !important;
    }

    /* hide default horizontal menu and use collapsed menu */
    .navbar-menu {
        display: none !important;
        gap: 0 !important;
        margin: 0 !important;
    }

    /* show toggle button */
    .navbar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    /* when navbar has .open, show the menu as a stacked panel */
    .navbar.open .navbar-menu {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 100% !important;
        background: rgba(10,10,50,50) !important;
        padding: 0.75rem 4% !important;
        gap: 0.5rem !important;
        z-index: 95 !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    }

    .navbar.open .navbar-menu li {
        list-style: none !important;
    }

    .navbar.open .navbar-menu a {
        display: block !important;
        padding: 0.8rem 1rem !important;
        font-size: 1.05rem !important;
        border-radius: 10px !important;
        background: rgba(255,255,255,0.03) !important;
        color: var(--light-color) !important;
        text-align: left !important;
        white-space: nowrap !important;
    }

    .navbar.open .navbar-menu a:hover,
    .navbar.open .navbar-menu a.active {
        background: rgba(255,215,0,0.12) !important;
        color: var(--dark-color) !important;
    }

    /* Ensure cart badge remains readable and tappable */
    .cart-badge {
        display: inline-block !important;
        padding: 0.25rem 0.45rem !important;
        font-size: 0.8rem !important;
    }
}


/* ============================================
   MOBILE READABILITY OVERRIDES
   Stronger contrast, remove heavy text effects, and
   ensure backgrounds are darker on small screens.
   ============================================ */

@media (max-width: 1024px) {
    /* Prevent the fixed-attachment artifacts on some mobile browsers */
    body {
        background-attachment: scroll;
    }

    /* Reduce intense heading effects for legibility */
    .hero-content h1,
    .featured-products h2,
    .about h2,
    .product-details h1 {
        text-shadow: none !important;
        animation: none !important;
    }

    /* Make glass panels more opaque (darker) for readable white text */
    .product-card,
    .catalog-header,
    .empty-state,
    .cart-item,
    .checkout-form,
    .cart-summary,
    .confirmation-container .order-details,
    .footer,
    .price-section,
    .order-item,
    .order-details,
    .confirmation-actions {
        background: rgba(0,0,0,0.35) !important;
        border-color: rgba(255,255,255,0.06) !important;
        color: var(--light-color) !important;
    }

    /* Ensure important text remains high contrast */
    .product-info h3,
    .product-details h1,
    .featured-products h2,
    .price,
    .price-big,
    .total-amount {
        color: var(--gold) !important;
    }

    /* Inputs and buttons slightly darker for clarity */
    .search-input,
    .form-group input,
    .form-group textarea,
    .quantity-selector,
    .quantity-control {
        background: rgba(255,255,255,0.06) !important;
        border-color: rgba(255,255,255,0.08) !important;
        color: var(--light-color) !important;
    }

    .btn-outline {
        border-color: rgba(255,255,255,0.2) !important;
        color: var(--light-color) !important;
    }
}

@media (max-width: 480px) {
    /* Further simplify for small phones */
    body {
        font-size: 16px;
        background: linear-gradient(135deg, #3b3f70 0%, #4a2b6a 100%);
    }

    .hero-content h1 {
        font-size: 1.9rem !important;
        line-height: 1.15 !important;
        padding: 0.2rem 0 !important;
    }

    .hero-subtitle {
        letter-spacing: 0.15rem !important;
        font-size: 0.9rem !important;
    }

    /* Stack cart item details vertically for clarity */
    .cart-item {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }

    /* Make product image full width but contained */
    .cart-item-image,
    .product-image {
        width: 100% !important;
        height: auto !important;
        min-height: 120px !important;
    }

    /* Make product cards easier to read */
    .product-card {
        padding: 1rem !important;
        border-radius: 14px !important;
    }

    /* Ensure buttons are tappable */
    .btn,
    .btn-primary,
    .btn-outline {
        padding: 0.9rem 1rem !important;
        font-size: 1rem !important;
    }

    /* Avoid clipped content from large shadows */
    .navbar,
    .footer {
        padding-left: 4% !important;
        padding-right: 4% !important;
    }
}

