/* =========================================
   CSS Variables & Theming
   ========================================= */
:root {
    /* Color Palette: Soft luxury, pink vibes */
    --color-primary: #e6b3b3;       /* Pastel pink */
    --color-primary-dark: #cc9999;
    --color-secondary: #f4d9d9;     /* Soft rose */
    --color-accent: #d4af37;        /* Subtle gold */
    --color-accent-light: #f3e5ab;
    --color-background: #fffcfc;    /* Clean warm white */
    --color-surface: #ffffff;
    --color-text-main: #333333;
    --color-text-muted: #777777;
    --color-border: #f0e0e0;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(230, 179, 179, 0.15);
    --shadow-lg: 0 8px 24px rgba(230, 179, 179, 0.2);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    background: none;
}

/* =========================================
   Typography & Utilities
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background-color: var(--color-border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--color-text-main);
}

.divider {
    height: 2px;
    width: 60px;
    background-color: var(--color-accent);
    margin: 15px auto 0;
}

/* =========================================
   Header / Navigation
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.nav-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: relative;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo a {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-text-main);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-main);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--color-surface);
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-link {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
    text-decoration: none;
    font-weight: 600;
}

.mobile-nav-link:hover {
    background: var(--color-background);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.admin-link:hover {
    color: var(--color-accent);
}

.cart-icon-container {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--color-text-main);
    transition: var(--transition);
}

.cart-icon-container:hover {
    color: var(--color-primary);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    height: 18px;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.8)),
                url('https://images.unsplash.com/photo-1594035910387-fea47794261f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    padding: 0 20px;
    margin-top: 60px; /* Offset for navbar */
}

.hero-content {
    max-width: 800px;
    animation: fadeIn 1.5s ease;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--color-text-main);
    text-shadow: 2px 2px 10px rgba(255,255,255,0.8);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 35px;
    color: var(--color-text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Shop Section & Product Grid
   ========================================= */
.shop-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--color-border);
}

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

.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect ratio */
    overflow: hidden;
    background-color: var(--color-secondary);
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 25px 20px;
    text-align: center;
}

.product-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--color-text-main);
}

.product-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
}

.add-to-cart-btn {
    width: 100%;
    background-color: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-text-main);
    padding: 10px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background-color: var(--color-text-main);
    color: #fff;
}

/* =========================================
   Shopping Cart Drawer
   ========================================= */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--color-surface);
    z-index: 1100;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

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

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.cart-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--color-text-main);
    transform: rotate(90deg);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

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

.cart-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

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

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    padding: 5px 10px;
    background: #f9f9f9;
}

.qty-btn:hover {
    background: #eee;
}

.qty-val {
    padding: 5px 10px;
    font-size: 0.9rem;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}

.remove-btn {
    color: #ff6b6b;
    font-size: 0.9rem;
    text-decoration: underline;
}

.empty-cart-msg {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 50px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
    background: #fdfdfd;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

/* =========================================
   Checkout Modal
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-surface);
    width: calc(100% - 20px);
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 10px;
}

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

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

.modal-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.checkout-summary {
    background: var(--color-secondary);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

/* =========================================
   Toast Notifications
   ========================================= */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-main);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    transition: bottom 0.4s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast.show {
    bottom: 30px;
}

/* =========================================
   Footer
   ========================================= */
footer {
    background-color: var(--color-text-main);
    color: #fff;
    padding: 60px 20px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.footer-brand p {
    color: #ccc;
    margin-bottom: 20px;
}

.social-icons a {
    color: #fff;
    font-size: 1.2rem;
}

.social-icons a:hover {
    color: var(--color-primary);
}

.footer-links h4, .footer-contact h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links a {
    display: block;
    color: #ccc;
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.footer-contact p {
    color: #ccc;
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #888;
    font-size: 0.9rem;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* =========================================
   Form Enhancements
   ========================================= */
#customer-province {
    max-height: 150px;
    overflow-y: auto;
}

#checkout-btn:disabled,
#checkout-form button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* =========================================
   Product Details Modal & Clickable Card
   ========================================= */
.clickable-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-card:hover {
    box-shadow: var(--shadow-md);
}

.product-details-content {
    max-width: 800px;
    width: calc(100% - 20px);
}

.pd-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 600px) {
    .pd-body {
        flex-direction: row;
        align-items: stretch;
    }
}

.pd-img-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.pd-img-container img {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

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

.pd-long-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-main);
    white-space: pre-line;
}

.pd-bottom {
    margin-top: auto; /* Pushes price and button to the bottom */
    padding-top: 20px;
}

.pd-price-large {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
}
