/*
 Theme Name:   WPCatalog
 Version:      1.0.4
 Author:       Team Codyas
 Author URI:   https://www.codyas.com
 Description:  Tema personalizado para gestionar catálogos como categorías de productos en WooCommerce.
 Text Domain:  wpcatalog
 Tags:         woocommerce, catalog, ecommerce
*/

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #1a1a1a;
    margin: 0;
}

.home-container, .catalog-container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 3rem;
    padding-bottom: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .home-container, .catalog-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .home-container, .catalog-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 639px) {
    .home-container, .catalog-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.catalog-card, .product-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    padding: 1rem;
    transition: all 0.3s ease;
}

.catalog-card {
    overflow: hidden;
    transform: translateY(0);
}

.catalog-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-card img, .catalog-card img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    border-radius: 0.5rem;
    border: none;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.product-card h3, .product-card p, .catalog-card h2, .catalog-card p {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: normal !important;
    font-size: 13px !important;
}

@media (max-width: 639px) {
    .product-card h3 {
        font-size: 15px;
        line-height: 20px;
    }
    .product-card p {
        font-size: 13px;
    }
    #product-list {
        padding-left: 0;
        padding-right: 0;
    }
}

.categories-menu {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

.categories-menu::-webkit-scrollbar {
    height: 6px;
}

.categories-menu::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 9999px;
}

.category-filter {
    background-color: #f2f2f2;
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 14px;
    margin-left: 4px;
    margin-right: 4px;
    transition-property: color, background-color;
    white-space: nowrap;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
}

.category-filter:hover {
    background-color: #e5e7eb;
    color: #3b82f6;
}

.category-filter.active {
    background-color: #1a1a1a;
    color: #ffffff;
}

.breadcrumbs {
    font-size: 12px;
    color: #6b7280;
    background-color: #f8f8f8;
    padding: 8px 12px;
    margin-top: 10px;
    margin-bottom: 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    color: #6b7280;
    font-size: 12px;
    text-decoration: none;
}

.breadcrumb-link:hover {
    color: #2563eb;
}

.breadcrumb-current {
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #9ca3af;
}

.breadcrumb-separator::before {
    content: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDggMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNSAxTDEgMi41TDQuNSA2TDEgOS41TDEuNSAxMUw2IDZMMi41IDFaIiBzdHJva2U9IiM9Y2EzYWYiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=');
    display: inline-block;
    vertical-align: middle;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.pagination-wrapper {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

nav.woocommerce-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 0;
}

nav.woocommerce-pagination ul.page-numbers li a,
nav.woocommerce-pagination ul.page-numbers li span {
    background-color: #f8f8f8;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
}

nav.woocommerce-pagination ul.page-numbers li span.current {
    background-color: #f8f8f8;
    color: #1a1a1a;
    font-weight: 600;
}

nav.woocommerce-pagination ul.page-numbers li a:hover {
    color: #2563eb;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2rem;
    text-align: center;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 0.5rem;
}

p {
    color: #4b5563;
    font-size: 1rem;
}

#loading-indicator {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 1rem 0;
    display: none;
}

.header {
    background-color: #1a1a1a;
    color: #ffffff;
    height: 75px;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
}

.header-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
}

@media (max-width: 639px) {
    .site-title {
        font-size: 1.25rem;
    }
}

.site-title a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.site-title a:hover {
    opacity: 0.8;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-menu {
    display: flex;
    gap: 1rem;
}

.header-menu a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.header-menu a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.header-links {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.header-links a {
    color: #3b82f6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.header-links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.header-links svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.header-links a:hover svg {
    transform: scale(1.1);
}

.header-search-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.header-search {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-field {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem 0 0 0.375rem;
    font-size: 0.875rem;
    background-color: #fff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-submit {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.375rem 0.375rem 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
}

.search-submit:hover {
    background-color: #2563eb;
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 767px) {
    .header {
        height: auto;
    }
    .header-container {
        flex-direction: column;
        padding: 1rem;
    }
    .site-title {
        display: none;
    }
    .header-search-wrapper {
        display: none;
    }
    .header-contact {
        display: none;
    }
    .header-mobile {
        display: block;
        width: 100%;
    }
    .site-title-mobile {
        text-align: center;
        margin-bottom: 1rem;
        font-size: 1.5rem;
        font-weight: 700;
    }
    .site-title-mobile a {
        color: #ffffff;
        text-decoration: none;
        transition: opacity 0.3s ease;
    }
    .site-title-mobile a:hover {
        opacity: 0.8;
    }
    .header-contact-mobile {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .header-contact-mobile a {
        color: #3b82f6;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        transition: color 0.3s ease;
    }
    .header-contact-mobile a:hover {
        color: #2563eb;
        text-decoration: underline;
    }
    .header-contact-mobile a svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
        transition: transform 0.3s ease;
    }
    .header-contact-mobile a:hover svg {
        transform: scale(1.1);
    }
    .header-search-mobile {
        display: block;
        width: 100%;
    }
    .header-search-mobile .search-form {
        display: flex;
        align-items: center;
        width: 100%;
    }
    .header-search-mobile .search-field {
        width: 100%;
        padding: 0.5rem 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.375rem 0 0 0.375rem;
        font-size: 0.875rem;
        background-color: #fff;
        color: #1a1a1a;
        outline: none;
        transition: border-color 0.3s ease;
    }
    .header-search-mobile .search-field:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    .header-search-mobile .search-submit {
        background-color: #3b82f6;
        color: #ffffff;
        border: none;
        padding: 0.5rem 0.75rem;
        border-radius: 0 0.375rem 0.375rem 0;
        cursor: pointer;
        transition: background-color 0.3s ease;
        display: flex;
        align-items: center;
    }
    .header-search-mobile .search-submit:hover {
        background-color: #2563eb;
    }
    .header-search-mobile .search-icon {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }
}

@media (min-width: 768px) {
    .header-mobile {
        display: none;
    }
}

.footer {
    background-color: #1a1a1a;
    color: #ffffff;
    width: 100%;
    margin: 0;
    padding: 2rem 0 0;
    box-sizing: border-box;
}

.footer-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.footer-copyright p {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

/* Estilos para el botón y modal */
.explore-categories-btn {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 12px;
}

/* Clearfix para el contenedor de botones */
.button-container {
    overflow: hidden;
}

/* Estilos para botones flotantes dentro de button-container */
.button-container .explore-categories-btn {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
}

.button-container .float-left {
    float: left;
}

.button-container .float-right {
    float: right;
}

/* Reducir padding en móviles */
@media (max-width: 639px) {
    .explore-categories-btn {
        padding: 0.5rem 1rem;
    }
}

.explore-categories-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.explore-categories-btn:hover::after {
    width: 200px;
    height: 200px;
}

.explore-categories-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.explore-catalog-btn {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    margin: 0 auto;
    text-align: center;
    width: 180px;
    font-size: 12px;
}

@media (max-width: 639px) {
    .explore-catalog-btn {
        width: 70%;
        max-width: none;
        padding: 0.5rem 1rem;
    }
}

.explore-catalog-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.explore-catalog-btn:hover::after {
    width: 200px;
    height: 200px;
}

.explore-catalog-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.modal-open {
    display: flex !important;
    opacity: 1;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
    transform: translateY(20px);
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-content.modal-open {
    transform: translateY(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.close-modal-btn:hover {
    color: #ef4444;
}

.modal-body {
    padding: 0 0.5rem;
}

.category-search {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-right: 0.5rem;
}

.category-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.category-list {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    overflow-x: hidden;
}

.category-item {
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.category-item a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-item a:hover {
    color: #3b82f6;
}

.category-count {
    color: #6b7280;
    font-size: 0.9rem;
    background-color: #e5e7eb;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    transition: background-color 0.3s ease;
}

.category-item:hover .category-count {
    background-color: #3b82f6;
    color: #ffffff;
}

/* Ícono SVG básico para cada categoría */
.category-item a::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%233b82f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line></svg>');
    display: inline-block;
    vertical-align: middle;
}

.category-item a:hover::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%238b5cf6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line></svg>');
}

/* Nuevos estilos mejorados para la tabla de detalles del producto */
.product-details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-details-table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.product-details-table tr:last-child td {
    border-bottom: none;
}

.product-details-table .label {
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    width: 40%;
    padding-right: 1rem;
    background-color: #f2f2f2;
}

.product-details-table .value {
    color: #1f2937;
    text-align: left;
    width: 60%;
    font-weight: 500;
}

.product-details-table tr:hover td {
    background-color: #f0f4f8;
}

.product-details-table tr:first-child td {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.product-details-table tr:last-child td {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Responsive: Ajustar en pantallas pequeñas con etiqueta y valor en línea */
@media (max-width: 640px) {
    .product-details-table {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .product-details-table tr {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 0.25rem;
    }

    .product-details-table td {
        padding: 0.25rem 0.5rem;
        width: 50%;
        box-sizing: border-box;
    }

    .product-details-table .label,
    .product-details-table .value {
        width: 50%;
        text-align: left;
        display: inline-flex;
        align-items: center;
        margin: 0;
        padding: 0.25rem;
    }

    .product-details-table .label {
        font-weight: 600;
        color: #1a1a1a;
        background-color: transparent;
        padding-right: 0.5rem;
        justify-content: flex-end;
    }

    .product-details-table .value {
        font-weight: 500;
        padding-left: 0.5rem;
        justify-content: flex-start;
    }

    .product-details-table tr:last-child {
        margin-bottom: 0;
    }
}

/* Estilo para la categoría debajo del título */
.product-category {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #3b82f6;
    text-align: center;
}

.product-category a {
    text-decoration: none;
    color: #3b82f6;
    font-weight: 500;
}

.product-category a:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* Estilos adicionales para la página principal */
.home-container h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2rem;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.catalog-card {
    text-decoration: none;
    display: block;
}

.catalog-card .p-6 {
    background-color: #ffffff;
}

.catalog-card a {
    text-decoration: none;
}

.product-card {
    text-decoration: none;
    display: block;
}

/* Estilo para el catálogo padre */
.product-catalog {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #3b82f6;
    text-align: center;
}

.product-catalog a {
    text-decoration: none;
    color: #3b82f6;
    font-weight: 500;
}

.product-catalog a:hover {
    text-decoration: underline;
    color: #2563eb;
}