@import url('https://fonts.googleapis.com/css2?family=Condiment&family=Metamorphous&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Condiment&family=MedievalSharp&family=Metamorphous&display=swap');

:root {
    --white: #F8F5EB;
    --gold: #C6A44B;
    --wine: #83072D;
    --gray: #8F9CA4;
    --black: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'MedievalSharp', cursive;
    background-color: var(--white);
    color: var(--black);
}

/* ========== HEADER ========== */
header { 
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100; 
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.top-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; background-color: var(--white);
    border-bottom: 3px solid var(--wine);
}

.logo { display: flex; align-items: center; }
.logo img { height: 70px; width: auto; }

.nav-icons { display: flex; align-items: center; gap: 8px; }
.nav-icons img { width: 24px; height: 24px; cursor: pointer; transition: transform 0.2s ease; }
.nav-icons img:hover { transform: scale(1.1); }

.hamburger-container { position: relative; display: flex; flex-direction: column; align-items: flex-end; }
.hamburger { cursor: pointer; padding: 5px; margin-left: 5px; position: relative; z-index: 1001; }
.hamburger img { width: 28px; height: auto; }

.gold-line {
    position: absolute; top: 100%; right: 10px; width: 3px; height: 0;
    background-color: var(--gold); transition: height 0.3s ease; z-index: 1000;
}
.gold-line.active { height: 30px; }

.dropdown-menu {
    position: absolute; top: 80px; left: 0; width: 100%;
    background-color: var(--white); padding: 15px 20px;
    display: none; z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-top: 3px solid var(--gold);
}
.dropdown-menu.active { display: block; }
.dropdown-menu ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
.dropdown-menu ul li a {
    color: var(--wine); text-decoration: none; font-family: 'Metamorphous', cursive;
    font-size: 14px; font-weight: 400; letter-spacing: 1px; transition: color 0.3s ease;
}
.dropdown-menu ul li a:hover { color: var(--gold); }
.dropdown-menu ul li a.active-link { color: var(--gold); border-bottom: 2px solid var(--gold); padding-bottom: 2px; }

#dropdownMenu { display: none !important; }
#dropdownMenu.active { display: block !important; }

/* ========== CART ICON BADGE ========== */
.cart-wrapper { position: relative; display: inline-block; }
.cart-badge {
    position: absolute; top: -6px; right: -8px;
    background-color: var(--wine); color: var(--white);
    font-family: 'Metamorphous', cursive; font-size: 10px;
    width: 18px; height: 18px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    line-height: 1;
}

/* ========== SEARCH & LOGIN & CART MODALS ========== */
.search-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8); z-index: 2000; display: none;
    justify-content: center; align-items: center;
}
.search-modal.active { display: flex; }

.search-container {
    background-color: var(--white); padding: 40px; border-radius: 5px;
    width: 90%; max-width: 500px; position: relative;
}
.search-container h3 { font-family: 'Metamorphous', cursive; color: var(--wine); margin-bottom: 20px; text-align: center; }
.search-container input {
    width: 100%; padding: 15px; border: 2px solid var(--wine);
    font-family: 'MedievalSharp', cursive; font-size: 16px; outline: none; background-color: var(--white);
}
.search-container input:focus { border-color: var(--gold); }

.search-close {
    position: absolute; top: 10px; right: 15px; background: none;
    border: none; font-size: 28px; color: var(--wine); cursor: pointer;
}

.search-results { max-height: 350px; overflow-y: auto; margin-top: 15px; }
.search-result-item {
    display: flex; align-items: center; gap: 15px; padding: 12px;
    border-bottom: 1px solid rgba(131,7,45,0.15); cursor: pointer;
    text-decoration: none; color: var(--black); transition: background-color 0.2s ease;
}
.search-result-item:hover { background-color: rgba(198,164,75,0.1); }
.search-result-img { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.search-result-info { flex: 1; }
.search-result-name { font-family: 'Metamorphous', cursive; font-size: 14px; color: var(--wine); }
.search-result-cat { font-family: 'MedievalSharp', cursive; font-size: 12px; color: var(--gray); text-transform: capitalize; }
.search-result-price { font-family: 'Metamorphous', cursive; font-size: 16px; color: var(--wine); font-weight: bold; }
.search-no-results { text-align: center; padding: 30px 10px; color: var(--gray); font-family: 'MedievalSharp', cursive; }

/* Login */
.login-container input {
    width: 100%; padding: 15px; border: 2px solid var(--wine);
    font-family: 'MedievalSharp', cursive; font-size: 16px; outline: none;
    background-color: var(--white); margin-bottom: 12px;
}
.login-container input:focus { border-color: var(--gold); }
.login-btn {
    width: 100%; padding: 12px; background-color: var(--wine); color: var(--white);
    border: none; font-family: 'Metamorphous', cursive; font-size: 14px;
    cursor: pointer; letter-spacing: 2px; transition: background-color 0.3s ease;
}
.login-btn:hover { background-color: #6a0625; }
.logout-btn { background-color: transparent; color: var(--wine); border: 2px solid var(--wine); margin-top: 15px; }
.logout-btn:hover { background-color: var(--wine); color: var(--white); }
.login-error { color: #cc0000; font-family: 'MedievalSharp', cursive; font-size: 13px; text-align: center; margin-top: 10px; }
.user-welcome { text-align: center; padding: 20px 0; }
.user-avatar { width: 60px; height: 60px; color: var(--wine); margin-bottom: 10px; }
.user-welcome p { font-family: 'MedievalSharp', cursive; font-size: 16px; }
.user-logged { position: relative; }
.user-logged::after {
    content: ''; position: absolute; bottom: -2px; right: -2px;
    width: 8px; height: 8px; background-color: #2d8a4e; border-radius: 50%; border: 1.5px solid var(--white);
}

/* ========== CATEGORY HERO ========== */
.category-hero {
    background-color: var(--wine);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    margin-top: 90px;
}

.category-hero h1 {
    font-family: 'Metamorphous', cursive;
    font-size: 28px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.category-hero p {
    font-family: 'MedievalSharp', cursive;
    font-size: 15px;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========== PRODUCTS GRID ========== */
.products-grid-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.product-grid-card {
    background-color: var(--white);
    border: 2px solid rgba(131,7,45,0.12);
    padding: 0;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-grid-card:hover {
    box-shadow: 0 6px 20px rgba(131,7,45,0.15);
    transform: translateY(-3px);
}

.product-grid-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-grid-img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    padding: 20px;
    background-color: rgba(198,164,75,0.04);
    border-bottom: 2px solid rgba(131,7,45,0.08);
}

.product-grid-info {
    padding: 15px 18px 10px;
    flex: 1;
}

.product-grid-name {
    font-family: 'Metamorphous', cursive;
    font-size: 15px;
    color: var(--wine);
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.product-grid-desc {
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    color: var(--gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px 18px;
}

.product-grid-price {
    font-family: 'Metamorphous', cursive;
    font-size: 16px;
    color: var(--wine);
    font-weight: bold;
}

.product-grid-price span {
    font-size: 14px;
}

.btn-add-grid {
    background-color: var(--wine);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    font-family: 'Metamorphous', cursive;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
}

.btn-add-grid:hover {
    background-color: #6a0625;
}

/* ========== CART MODAL ========== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(131,7,45,0.12);
}

.cart-item-img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    border: 1px solid rgba(131,7,45,0.1);
    border-radius: 3px;
    flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
    font-family: 'Metamorphous', cursive;
    font-size: 13px;
    color: var(--wine);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    color: var(--black);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 26px; height: 26px;
    background-color: var(--wine); color: var(--white);
    border: none; border-radius: 3px;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Metamorphous', cursive;
    transition: background-color 0.2s ease;
}

.cart-qty-btn:hover { background-color: #6a0625; }

.cart-qty {
    font-family: 'Metamorphous', cursive;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.cart-remove-btn {
    width: 26px; height: 26px;
    background-color: transparent; color: var(--wine);
    border: 1px solid var(--wine); border-radius: 3px;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.cart-remove-btn:hover { background-color: var(--wine); color: var(--white); }

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 5px;
    border-top: 2px solid var(--wine);
    margin-top: 10px;
}

.cart-total-label {
    font-family: 'Metamorphous', cursive;
    font-size: 16px;
    color: var(--black);
    letter-spacing: 1px;
}

.cart-total-amount {
    font-family: 'Metamorphous', cursive;
    font-size: 22px;
    color: var(--wine);
    font-weight: bold;
}

.cart-empty-msg {
    text-align: center;
    padding: 30px 10px;
    font-family: 'MedievalSharp', cursive;
    font-size: 15px;
    color: var(--gray);
}

.cart-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.cart-actions button {
    flex: 1;
    padding: 12px;
    font-family: 'Metamorphous', cursive;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-cart {
    background-color: transparent;
    color: var(--wine);
    border: 2px solid var(--wine);
}

.btn-clear-cart:hover {
    background-color: var(--wine);
    color: var(--white);
}

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

.btn-checkout:hover {
    background-color: #6a0625;
    border-color: #6a0625;
}

/* ========== CART NOTIFICATION ========== */
.cart-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--wine);
    color: var(--white);
    padding: 14px 24px;
    font-family: 'Metamorphous', cursive;
    font-size: 14px;
    letter-spacing: 1px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* ========== NEWSLETTER ========== */
.newsletter-modal-container {
    max-width: 450px;
}

/* ========== FOOTER ========== */
footer {
    background-color: var(--wine, #83072D);
    position: relative;
    margin-top: 80px; 
}

.footer-castle {
    position: absolute;
    top: -55px; 
    right: 5%;
}

.footer-castle img {
    height: 60px;
    width: auto;
}

.footer-main-row {
    display: flex;
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    gap: 20px;
}

.footer-logo img {
    height: 110px; 
    width: auto;
}

.footer-col h4 {
    font-family: 'Metamorphous', cursive;
    color: var(--white, #F8F5EB);
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.footer-col ul li {
    margin-bottom: 5px;
}

.footer-col ul li a {
    color: var(--white, #F8F5EB);
    text-decoration: none;
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: var(--gold, #C6A44B);
    text-decoration: underline;
}

.footer-newsletter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-newsletter img {
    height: 65px;
    width: auto;
}

.footer-newsletter-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-newsletter-text h4 {
    font-family: 'Metamorphous', cursive;
    color: var(--white, #F8F5EB);
    font-size: 20px;
    margin: 0;
    letter-spacing: 1px;
}

.btn-suscribete {
    background-color: var(--white, #F8F5EB);
    color: var(--wine, #83072D);
    padding: 6px 22px;
    border-radius: 20px;
    text-decoration: none;
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-suscribete:hover {
    background-color: var(--gold, #C6A44B);
    color: var(--white, #F8F5EB);
}

.footer-socials {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-socials a svg {
    width: 32px;
    height: 32px;
    fill: var(--white, #F8F5EB); 
    transition: transform 0.2s;
}

.footer-socials a:hover svg {
    transform: scale(1.15);
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.15);
    color: var(--white, #F8F5EB);
    text-align: center;
    padding: 10px;
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
}

/* Y si no tienes estos @media en tu categoria.css, añádelos al final de todo: */
@media (max-width: 1024px) {
    .footer-main-row {
        flex-wrap: wrap;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .footer-main-row {
        flex-direction: column;
        gap: 35px;
    }
    .footer-castle {
        top: -45px;
    }
}
/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .footer-main-row {
        flex-wrap: wrap;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .footer-main-row {
        flex-direction: column;
        gap: 35px;
    }
    .footer-castle {
        top: -45px;
    }
}
@media (max-width: 768px) {
    .dropdown-menu { top: 70px; }
    .dropdown-menu ul { gap: 10px; }
    .dropdown-menu ul li a { font-size: 12px; }
    .gold-line.active { height: 20px; }

    .category-hero h1 { font-size: 22px; }
    .category-hero { padding: 30px 15px; }

    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .product-grid-img { height: 180px; padding: 12px; }
    .product-grid-name { font-size: 13px; }
    .product-grid-price { font-size: 18px; }
    .btn-add-grid { padding: 8px 12px; font-size: 10px; }
    .product-grid-footer { flex-direction: column; gap: 10px; align-items: flex-start; }
}

@media (min-width: 769px) {
    .top-header { padding: 15px 40px; }
    .logo img { height: 80px; }
    .nav-icons img { width: 28px; height: 28px; }
    .dropdown-menu { top: 110px; }
    .dropdown-menu ul { gap: 40px; }
    .dropdown-menu ul li a { font-size: 16px; }
    .footer-links-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    .footer-top { padding: 35px 40px; }
    .footer-top-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 40px;
    }
    .social-icons a { width: 45px; height: 45px; }
    .social-icons a svg { width: 32px; height: 32px; }

    .category-hero h1 { font-size: 34px; }
    .category-hero { padding: 50px 40px; margin-top: 110px; }
}
