/* ============================================
   At the Vineyards - www Theme
   ============================================
   Deep wine and burgundy vineyard palette.
   ============================================ */

/* ============================================
   CSS VARIABLES
   Override these in theme-specific CSS files
   ============================================ */
:root {
    /* Primary Colors - Deep Wine/Burgundy */
    --primary-color: #722F37;
    --primary-color-rgb: 114, 47, 55;
    --primary-dark: #4e1f25;
    --primary-light: #9B4A52;

    /* Secondary Colors - Merlot/Rose */
    --secondary-color: #A0485A;
    --secondary-dark: #7A2F3A;
    --secondary-light: #C47A85;

    /* Accent Colors */
    --accent-green: #5A7A3A;
    --accent-hot: #ff4444;
    --accent-mild: #C8A96E;
    --accent-orange: #D4895A;

    /* Background Colors */
    --background-cream: #FDF8F0;
    --background-white: #FFFFFF;
    --background-light: #F9F1E8;

    /* Text Colors */
    --text-dark: #2C1810;
    --text-gray: #6B5B55;
    --text-light: #9B8B85;

    /* Border & Shadows */
    --border-color: #E0D0C8;
    --shadow-sm: 0 1px 3px rgba(114, 47, 55, 0.1);
    --shadow-md: 0 2px 8px rgba(114, 47, 55, 0.12);
    --shadow-lg: 0 4px 12px rgba(114, 47, 55, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-golden: linear-gradient(135deg, #C8A96E 0%, #E0C890 100%);
    --gradient-hot: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    --gradient-overlay: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-white);
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-gray);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-light);
    opacity: 0.85;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-fluid {
    width: 100%;
    padding: 2rem 1rem;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: var(--gradient-primary);
    color: white;
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: white;
    opacity: 1;
}

.navbar-brand img {
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-mild);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-mild);
    opacity: 1;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.error-message,
.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.success-message,
.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #060;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature {
    background: white;
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* ============================================
   PRODUCT STYLES
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--background-light);
}

/* Product image container for CMS template products */
.product-img-container {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
}

.product-img-container img {
    width: 100% !important;
    height: 100% !important;
    max-height: 200px !important;
    object-fit: cover !important;
    display: block !important;
}

.product-content {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-description {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0.75rem 0;
    line-height: 1.5;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    z-index: 10;
}

.product-badge.sale { background: var(--accent-hot); }
.product-badge.new { background: var(--accent-green); }
.product-badge.featured { background: var(--primary-color); }

/* Stock Information */
.stock-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.stock-info.in-stock { color: var(--accent-green); }
.stock-info.low-stock { color: #ff9800; }
.stock-info.out-of-stock { color: var(--accent-hot); }

/* Heat Level Indicators */
.heat-level {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.heat-level.heat-mild    { background: #fff9c4; color: #f57f17; }
.heat-level.heat-medium  { background: #ffe0b2; color: #e65100; }
.heat-level.heat-hot     { background: #ffccbc; color: #d84315; }
.heat-level.heat-extreme { background: #ffcdd2; color: #c62828; }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    background: var(--background-cream);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

/* Size Options */
.size-options {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.size-btn {
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.size-btn:hover,
.size-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* ============================================
   CART & CHECKOUT
   ============================================ */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.shipping-option {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shipping-option:hover {
    border-color: var(--primary-color);
}

.shipping-option.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

.shipping-option input[type="radio"] {
    width: auto;
    margin-right: 1rem;
}

.shipping-info { flex: 1; }

.shipping-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.shipping-estimate {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.shipping-price {
    font-weight: 600;
    font-size: 1.1rem;
}

.shipping-price.free { color: var(--accent-green); }

.order-summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

#paypal-button-container {
    min-height: 150px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--background-light);
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
    color: var(--text-gray);
    border-top: 3px solid var(--primary-color);
}

footer .container {
    padding: 0 1.5rem;
}

footer h3,
footer h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

footer p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

footer a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 0.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.fade-in      { animation: fadeIn 0.6s ease-out; }
.slide-in-left { animation: slideInLeft 0.6s ease-out; }

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 { font-size: 2rem; }
    .hero p  { font-size: 1rem; }

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

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

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

    .container { padding: 1.5rem 1rem; }

    /* Force single column inline grid layouts */
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select { width: 100%; }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 480px) {
    .hero { padding: 0.5rem 1rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero p  { font-size: 0.95rem; }

    .container { padding: 1rem 0.5rem; }

    .card { padding: 1rem; }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .product-image { height: 200px; }

    .navbar-brand { font-size: 1.2rem; }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
}

/* ============================================
   RESPONSIVE - LARGE SCREENS
   ============================================ */
@media (min-width: 1200px) {
    .container { max-width: 1400px; }

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

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar,
    .filter-bar,
    footer,
    .btn,
    form {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}