/* Main Brands Section */
.brands-main-section {
    padding: 60px 0 80px;
    background: #fafafa;
    min-height: calc(100vh - 300px);
}

.section-title {
    font-size: 3rem;
    color: #1a1a1a;
    margin-bottom: 40px;
    font-weight: 800;
    text-align: center;
}


/* Catalog Controls */
.catalog-controls {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 50px;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input,
.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.search-bar input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--color-uva, #502033);
    box-shadow: 0 0 10px rgba(181, 145, 62, 0.2);
}

.search-bar i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

/* Advanced Filters */
.advanced-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-uva, #502033);
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
}

.btn-clear-filters {
    padding: 0;
    background: transparent;
    color: #666;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-clear-filters:hover {
    background: transparent;
    color: var(--color-uva, #502033);
    text-decoration: underline;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--color-uva, #502033);
}

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

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

.product-image {
    position: relative;
    width: 100%;
    padding-top: 85%;
    overflow: hidden;
    background: #2d2d2d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
}

.product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 20px;
}

.product-card:hover .product-image img {
    transform: translate(-50%, -50%) scale(1.08);
}

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

.product-info h3 {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 12px;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    justify-content: center;
    min-height: 24px;
}

.product-specialty {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #5c5a57;
    font-weight: 500;
}

.badge-country,
.badge-year {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-country {
    background: #f5f5f5;
    color: #666;
}

.badge-year {
    background: #f5f5f5;
    color: #666;
}

.eco-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-uva, #502033);
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(181, 145, 62, 0.3);
}

/* Ally actions and buttons (Ver marca / Contactar) */
.ally-actions {
    display: flex;
    gap: 10px;
}

.btn-ally,
.btn-view-more,
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Filled (violet) style */
.btn-view-more,
.btn-contact {
    background: var(--color-uva, #502033);
    color: #fff;
    border: 2px solid var(--color-uva, #502033);
}

.btn-view-more:hover,
.btn-contact:hover {
    background: #6e3a57; /* lighter violet */
    border-color: #6e3a57;
    transform: translateY(-2px);
}

/* Outline variant if used */
.btn-ally-outline {
    background: transparent !important;
    color: var(--color-uva, #502033) !important;
    border: 2px solid var(--color-uva, #502033) !important;
}

.btn-ally-outline:hover {
    background: var(--color-uva, #502033) !important;
    color: #fff !important;
}


/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }

    .category-title {
        font-size: 2.5rem;
    }

    .brand-logo h3 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .category-tabs {
        gap: 10px;
    }

    .category-tab {
        padding: 15px 20px;
        font-size: 14px;
    }

    .category-tab i {
        font-size: 20px;
    }

    .category-title {
        font-size: 2rem;
    }

    .advanced-filters {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-info h3 {
        font-size: 0.9rem;
        min-height: 36px;
    }

    .ally-actions {
        flex-direction: column;
    }

    .btn-ally {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .product-info h3 {
        font-size: 0.85rem;
        min-height: 32px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    margin: 20px;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-close {
    position: sticky;
    top: 10px;
    right: 10px;
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: #666;
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: var(--color-uva, #502033);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    padding: 40px 40px 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #2d2d2d;
    padding: 10px;
    border-radius: 12px;
}

.modal-header h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin: 0;
}

.modal-body {
    padding: 40px;
}

.modal-hero {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

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

.modal-info {
    margin-bottom: 40px;
}

.modal-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.modal-specialty {
    font-size: 1.2rem;
    color: var(--color-uva, #502033);
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-description {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

.modal-products {
    margin-bottom: 40px;
}

.modal-products h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 20px;
}

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

.product-gallery-item {
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.product-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    padding: 20px;
    background: white;
}

.product-gallery-item p {
    padding: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #1a1a1a;
    background: #f9f9f9;
}

.modal-actions {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* WhatsApp Modal Specific Styles */
.modal-whatsapp {
    max-width: 600px;
}

.modal-whatsapp .modal-header {
    flex-direction: column;
    text-align: center;
}

.whatsapp-intro {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    text-align: center;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.whatsapp-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    resize: vertical;
    transition: all 0.3s ease;
}

.whatsapp-textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

.country-whatsapp-selection h4 {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-align: center;
}

.whatsapp-country-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-whatsapp-country {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    min-width: 140px;
}

.btn-whatsapp-country:hover {
    border-color: #25D366;
    background: #f0fdf4;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp-country img {
    width: 40px;
    height: auto;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-hero {
        height: 250px;
    }

    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-large {
        width: 100%;
        padding: 15px;
    }

    .whatsapp-country-buttons {
        flex-direction: column;
    }

    .btn-whatsapp-country {
        width: 100%;
    }
}

/* Brand palette overrides */
.brands-hero {
    background: linear-gradient(135deg, rgba(47, 36, 23, 0.96), rgba(80, 32, 51, 0.85));
    color: var(--color-beige);
}

.hero-title {
    color: var(--color-gold);
}

.hero-subtitle {
    color: rgba(253, 247, 235, 0.85);
}

.brands-main-section {
    background: var(--color-beige);
}

.section-title {
    color: var(--color-carbon);
}

.search-bar input,
.search-input {
    border: 2px solid rgba(47, 36, 23, 0.15);
    background: var(--color-beige);
}

.search-bar input:focus,
.search-input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 12px rgba(181, 145, 94, 0.25);
}

.search-bar i {
    color: rgba(47, 36, 23, 0.55);
}

.advanced-filters {
    background: var(--color-cream);
    box-shadow: 0 20px 45px rgba(47, 36, 23, 0.08);
}

.filter-group label {
    color: var(--color-carbon);
}

.filter-select {
    border: 2px solid rgba(47, 36, 23, 0.15);
    background: var(--color-beige);
}

.filter-select:focus {
    border-color: var(--color-gold);
}

.btn-clear-filters {
    color: var(--color-carbon);
}

.btn-clear-filters:hover {
    color: var(--color-gold);
}

.product-card {
    background: var(--color-cream);
    border: 1px solid rgba(47, 36, 23, 0.1);
}

.product-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 15px 35px rgba(47, 36, 23, 0.15);
}

.product-image {
    background: var(--color-carbon);
    border-bottom: 1px solid rgba(47, 36, 23, 0.2);
}

.product-info h3 {
    color: var(--color-carbon);
}

.product-category,
.badge-brand {
    background: var(--color-gold);
    color: var(--color-beige);
}

.product-description,
.badge-fragrance {
    color: rgba(47, 36, 23, 0.7);
    background: var(--color-cream);
}

.badge-eco,
.eco-badge {
    background: var(--color-green);
    color: var(--color-beige);
}

.modal-content {
    background: var(--color-cream);
}

.modal-header,
.modal-body {
    background: transparent;
    color: var(--color-carbon);
}

.btn-whatsapp-country {
    border-color: transparent;
}

.btn-whatsapp-country:hover {
    border-color: var(--color-green);
    background: rgba(86, 110, 43, 0.12);
    box-shadow: 0 6px 20px rgba(86, 110, 43, 0.2);
}



.products-grid-wrapper {
    position: relative;
    overflow: hidden;
    max-height: calc((220px + 24px) * 4);
    transition: max-height 0.4s ease;
}

.products-grid-wrapper.is-expanded {
    max-height: none;
}

.btn-show-more {
    margin: 24px auto 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: 1px solid var(--color-uva, #502033);
    background: transparent;
    color: var(--color-uva, #502033);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 30px;
}

.btn-show-more:hover {
    background: var(--color-uva, #502033);
    color: #fff;
}


/* Ally-inspired brand cards */
.products-grid .product-card {
    background: transparent;
    border: none;
    padding: 12px;
    animation: fadeIn 0.5s ease;
}

.products-grid .product-card:hover {
    transform: translateY(-4px);
}

.ally-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    background: #fff;
    padding: 28px 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    height: 100%;
}

.brand-card-logo {
    --brand-circle-size: clamp(120px, 16vw, 182px);
    width: 100%;
    height: clamp(138px, 20vw, 170px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    isolation: isolate;
    filter: none;
}

.brand-card-logo img {
    max-width: calc(var(--brand-circle-size) * 0.66);
    max-height: calc(var(--brand-circle-size) * 0.66);
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Memo Paris usa asset blanco dedicado; mantenemos sombra sin alterar color. */
.brand-card-logo img.brand-logo-memo,
.brand-card-logo img[alt="Memo Paris"] {
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.12)) !important;
}

.brand-card-logo::before {
    content: '';
    position: absolute;
    width: var(--brand-circle-size);
    height: var(--brand-circle-size);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #c9b08a, #8b6a3e);
    box-shadow: 0 15px 35px rgba(47, 36, 23, 0.35);
    opacity: 1;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

.ally-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.product-badges {
    margin-bottom: 0;
}

.product-specialty {
    font-size: 0.9rem;
    color: #5c5a57;
}

.ally-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-ally {
    flex: 1;
    border-radius: 999px;
    border: 1px solid var(--color-uva, #502033);
    background: transparent;
    color: var(--color-uva, #502033);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.2;
    min-width: 0;
    white-space: normal;
    transition: all 0.3s ease;
}

.btn-ally-outline {
    background: var(--color-uva, #502033);
    color: #fff;
}

.btn-ally:hover {
    background: var(--color-uva, #502033);
    color: #fff;
}

.btn-ally-outline:hover {
    filter: brightness(1.05);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
