:root {
    --primary: #D4AF37;
    --primary-dark: #B38E22;
    --secondary: #111111;
    --text-main: #EFEFEF;
    --text-light: #A0A0A0;
    --bg-main: #141414;
    --bg-card: #1F1F1F;
    --accent: #E5A93B;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

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

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Hero Section */
.hero {
    padding: 6rem 5%;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.7)), url('/images/olivar.webp');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #FFFFFF;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.hero p {
    font-size: 1.3rem;
    color: #F8F8F8;
    max-width: 700px;
    margin: 0 auto 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(140, 153, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 153, 0, 0.4);
}

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

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

/* Products Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 5%;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 800;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.product-img-wrapper {
    width: 35%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    background-color: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color:  #ffffff;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    padding: 7%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.product-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

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

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

.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.price-original {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.price.has-offer {
    color: #E53E3E;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 4rem auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

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

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

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 153, 0, 0.1);
}

/* Admin layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--text-main);
    color: white;
    padding: 2rem 0;
}

.admin-brand {
    padding: 0 2rem 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 2rem;
}

.admin-nav a {
    display: block;
    padding: 1rem 2rem;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--primary);
}

.admin-content {
    flex: 1;
    background: #F8FAFC;
    padding: 2rem;
}

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

.admin-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.admin-table tr:hover {
    background: #F8FAFC;
}

/* Modal Compra */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal-compra {
    background: #ffffff;
    color: #333333;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-compra {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #999999;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #333333;
}

.modal-body {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    align-items: center;
}

.modal-img {
    width: 40%;
    max-width: 350px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1/1;
    flex-shrink: 0;
}

.modal-img img {
    width: 90%;
    height: 90%;
    object-fit: cover;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.modal-info p {
    color: #666666;
    margin-bottom: 1.5rem;
}

.modal-price {
    font-size: 2rem;
    font-weight: 800;
    color: #111111;
    margin-bottom: 1.5rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    overflow: hidden;
    width: max-content;
}

.qty-btn {
    background: transparent;
    color: #333333;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

#qtyInput {
    width: 50px;
    height: 40px;
    background: transparent;
    border: none;
    color: #333333;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    -moz-appearance: textfield;
}

#qtyInput::-webkit-outer-spin-button,
#qtyInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 5%;
    }
    .nav-brand img {
        height: 60px !important;
    }
    .nav-actions {
        gap: 0.5rem;
    }
    .hero {
        background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.8)), url('/images/olivar-movil.webp');
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .product-card {
        flex-direction: column-reverse;
    }
    .product-img-wrapper {
        width: 100%;
        max-width: none;
    }
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        padding: 1rem;
    }
    .modal-body {
        flex-direction: column;
    }
    .modal-img {
        width: 100%;
        max-width: none;
    }
    .modal-compra {
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
}
/* Carousel and Modal Zoom styles */
.product-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
}
.carousel-item {
    min-width: 100%;
    max-width: 100%;
    object-fit: contain;
    height: 100%;
    object-position: center;
    display: block;
}
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #333;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0;
}
.product-card:hover .carousel-control {
    opacity: 1;
}
.carousel-control:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.carousel-control.prev { left: 10px; }
.carousel-control.next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    background: rgba(255,255,255,0.4);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}
.dot.active {
    background: #B38E22;
    width: 18px;
    border-radius: 10px;
    border-color: #B38E22;
}

#zoomModal .modal-compra {
    max-width: 90vw;
    height: 80vh;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
}
#zoomModal .modal-body {
    height: 100%;
    width: 100%;
    margin: 0;
    gap: 0;
}
#zoomModal .modal-img {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    background: #fff;
}
#zoomModal .carousel-control {
    opacity: 1 !important;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}
#zoomModal .modal-close {
    z-index: 2100;
    color: #333;
    background: rgba(255,255,255,0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 2rem;
    right: 2rem;
}
#zoomModal .carousel-dots {
    background: rgba(255,255,255,0.6);
    padding: 6px 15px;
    border-radius: 30px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    gap: 12px;
}
#zoomModal .dot {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.8);
}
#zoomModal .dot.active {
    width: 25px;
    background: #B38E22;
    border-color: #B38E22;
}

.btn-zoom-desktop {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #B38E22;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #B38E22;
    z-index: 15;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    justify-content: center;
}
@media (min-width: 769px) {
    .product-img-wrapper:hover .btn-zoom-desktop {
        opacity: 1;
    }
    .btn-zoom-desktop {
        display: flex;
    }
}
