:root {
    --primary: #1e3a8a;
    /* Deep blue */
    --primary-light: #3b82f6;
    --accent: #8b5cf6;
    /* Soft purple */
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
    padding-bottom: 80px;
}

/* Dynamic Background Shapes */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(147, 197, 253, 1) 0%, rgba(255, 255, 255, 0) 70%);
}

.shape-2 {
    bottom: -10%;
    right: -5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(196, 181, 253, 1) 0%, rgba(255, 255, 255, 0) 70%);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(253, 186, 116, 0.5) 0%, rgba(255, 255, 255, 0) 70%);
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.05);
    }
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
    font-size: 1.8rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Navbar */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    z-index: 1000;
    background: white;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.logo {
    flex-shrink: 0; /* Prevents logo from being squished */
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px !important; /* Tightens space between Login and Cart */
}
.nav-action-btn {
    padding: 4px 6px;
    gap: 4px !important;
}

.nav-label {
    font-size: 0.85rem !important;
    font-weight: 500;
}
.cart-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transform: translate(25%, -25%);
}

/* Sidebar */
.side-menu {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    padding: 2rem;
    z-index: 2000;
    transition: left var(--transition);
    display: flex;
    flex-direction: column;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.side-menu.open {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.menu-item {
    background: transparent;
    border: none;
    text-align: left;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.menu-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
}

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin: 3rem 0;
    animation: fadeIn 0.8s ease-out;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Category Slider */
.categories-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: none;
    /* Firefox */
}

.categories-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome */
}

.cat-pill {
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.cat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Products Grid */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    animation: floatUp 0.6s ease-out forwards;
    opacity: 0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
}

.product-img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.2rem;
    background: #f1f5f9;
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Modals & Cart Drawer */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 2rem;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-detail-img {
    width: 100%;
    max-width: 400px;      /* Stops it from elongating horizontally */
    aspect-ratio: 1 / 1;   /* Keeps it square like the card */
    object-fit: cover;
    display: block;        /* Necessary for centering */
    margin: 0 auto 1.5rem auto; /* Centers the image in the modal */
    border-radius: var(--radius-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
}

.modal-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

textarea,
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    transition: var(--transition);
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    right: -400px;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transition: right var(--transition);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.cart-drawer.open {
    right: 0;
}

.target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: var(--radius-md);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 500;
}

.cart-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.total-row .price {
    color: var(--primary);
}

/* Admin Grid */
.admin-content {
    max-width: 800px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-panel h3 {
    margin-bottom: 1rem;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

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

/* Responsive */
@media(max-width: 400px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 1rem;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .product-card {
        padding: 0.8rem;
    }

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

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .cart-drawer {
        border-radius: 0;
    }
    .logo-text {
        font-size: 1rem; /* Extra shrink for very small screens */
    }
    .navbar {
        padding: 0.8rem 0.5rem;
    }
}

/* Shipping Banner */
.shipping-banner {
    background: linear-gradient(90deg, #fce7f3, #e0e7ff, #fce7f3);
    color: var(--primary);
    text-align: center;
    padding: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    letter-spacing: 0.5px;
}

/* Product Tags */
.product-img-wrap {
    position: relative;
}

.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--primary);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
    pointer-events: none;
}

/* Star Ratings */
.stars-container {
    color: #fbbf24;
    /* Amber color */
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 5px;
}

.stars-count {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 6px;
}

/* Buttons */
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.1);
}

.order-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

/* Review Stars Input */
.star-input {
    font-size: 1.5rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s;
}

.star-input:hover,
.star-input.active {
    color: #fbbf24;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.floating-socials {
    position: fixed;
    right: 15px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.floating-socials img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.floating-socials img:hover {
    transform: scale(1.15);
}