/* Estilos generales */
.products-main {
    padding: 1.5rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.intro-section {
    margin-bottom: 2rem;
    text-align: center;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
}

.intro-content h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    position: relative;
}

.intro-content h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: var(--primary-color);
}

.intro-text {
    text-align: left;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 0.95rem;
}

.intro-text p {
    margin-bottom: 1rem;
}

.signature {
    font-style: italic;
    text-align: right;
    font-weight: 500;
    margin-top: 1.2rem;
    font-size: 0.95rem;
}

/* Filtros de productos */
.products-filter {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 0 0.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    max-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 0.5rem 0.7rem;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    flex-grow: 1;
}

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

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

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.product-info {
    padding: 1rem;
}

.product-category {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.product-name {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    min-height: 2.8rem;
    line-height: 1.3;
}

.product-description {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.6rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

.view-details-btn, .add-to-cart-btn {
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

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

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

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
}

.add-to-cart-btn:hover {
    background: #d63384;
    transform: translateY(-2px);
}

/* Modal de producto */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 850px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal-product-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.modal-product-images {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.main-image {
    height: 250px;
    overflow: hidden;
    border-radius: 6px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-product-info h2 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-description {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.product-specs h3, .product-notes h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 0.6rem;
}

.product-specs ul {
    list-style-type: disc;
    padding-left: 1.2rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.product-specs li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.product-notes p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

/* Sección de acciones en modal */
.product-actions {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.color-selector, .quantity-selector {
    margin-bottom: 0;
}

.color-selector label, .quantity-selector label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.color-selector select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    background-color: white;
}

.quantity-selector {
    margin-top: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-top: 0.3rem;
}

.quantity-control button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.3s;
}

.quantity-control button:hover {
    background: #d63384;
}

.quantity-control input {
    width: 50px;
    height: 32px;
    text-align: center;
    margin: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
    text-align: left;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.add-to-cart-btn:hover {
    background: #d63384;
    transform: translateY(-2px);
}

/* Carrito de compras */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.close-cart {
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--primary-color);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: calc(100vh - 130px);
}

.cart-item {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--dark-color);
    font-size: 0.92rem;
    line-height: 1.3;
}

.cart-item-color, .cart-item-price {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.cart-item-quantity button {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.cart-item-quantity input {
    width: 40px;
    height: 28px;
    text-align: center;
    margin: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.85rem;
}

.cart-item-remove {
    color: #ff6b6b;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.5rem;
    display: inline-block;
}

.cart-summary {
    padding: 1.2rem;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background: white;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background: #d63384;
}

/* Botón flotante del carrito */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-cart-btn:hover {
    background-color: #d63384;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.floating-cart-btn i {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Notificación de producto añadido */
.cart-notification {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.cart-notification span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive */
@media (min-width: 768px) {
    .products-main {
        padding: 2rem;
    }

    .modal-product-details {
        grid-template-columns: 1fr 1fr;
    }

    .intro-content h1 {
        font-size: 2.2rem;
    }

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

@media (max-width: 576px) {
    .products-filter {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0;
    }

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

    .filter-group select {
        padding: 0.7rem;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.2rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .main-image {
        height: 220px;
    }

    .modal-product-info h2 {
        font-size: 1.3rem;
    }

    .product-actions {
        gap: 0.8rem;
    }

    .quantity-control button {
        width: 36px;
        height: 36px;
    }

    .quantity-control input {
        width: 50px;
        height: 36px;
    }

    .cart-sidebar {
        max-width: 100%;
    }

    .floating-cart-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .floating-cart-btn i {
        font-size: 1.3rem;
    }

    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .cart-notification {
        bottom: 80px;
        right: 20px;
        padding: 10px 16px;
    }
}