/**
 * Costa Dental Center - Estilos de la Tienda
 */

/* ===== Variables específicas de tienda ===== */
:root {
    --cart-badge: #e74c3c;
}

/* ===== Carrito en Header ===== */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--off-white);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 1.2rem;
    transition: var(--transition-normal);
}

.cart-icon:hover {
    background: var(--primary);
    color: var(--white);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--cart-badge);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Filtros de Tienda ===== */
.shop-filters {
    background: var(--white);
    padding: 20px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.shop-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    background: var(--off-white);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--dark-gray);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: var(--white);
}

.shop-search {
    display: flex;
    gap: 10px;
    max-width: 350px;
    width: 100%;
}

.shop-search input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.shop-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.shop-search button {
    padding: 12px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition-normal);
}

.shop-search button:hover {
    background: var(--primary-dark);
}

/* ===== Grid de Productos ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ===== Card de Producto ===== */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.product-card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--off-white);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 15px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-badge.destacado {
    background: var(--accent);
    color: var(--dark-gray);
}

.product-badge.oferta {
    background: var(--error);
    color: var(--white);
}

.product-actions {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-normal);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.product-action-btn {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
}

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

.product-card-content {
    padding: 25px;
}

.product-category {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-name a {
    color: inherit;
}

.product-name a:hover {
    color: var(--primary);
}

.product-description {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.product-price-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price-old {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
}

.product-add-cart {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 26, 26, 0.3);
}

/* ===== Página de Producto Individual ===== */
.product-single {
    padding: 60px 0;
}

.product-single-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 140px;
}

.product-main-image {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--off-white);
    margin-bottom: 15px;
}

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

.product-thumbnails {
    display: flex;
    gap: 10px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-normal);
}

.product-thumbnail.active,
.product-thumbnail:hover {
    border-color: var(--primary);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px 0;
}

.product-info .product-category {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-info h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.product-info .product-price {
    margin-bottom: 25px;
}

.product-info .product-price-current {
    font-size: 2rem;
}

.product-short-desc {
    font-size: 1.1rem;
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--light-gray);
}

.product-quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.product-quantity label {
    font-weight: 600;
    color: var(--dark-gray);
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-btn {
    width: 45px;
    height: 45px;
    background: var(--off-white);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.quantity-input {
    width: 60px;
    height: 45px;
    text-align: center;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.quantity-input:focus {
    outline: none;
}

.product-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.product-buttons .btn {
    flex: 1;
    padding: 15px 30px;
}

.product-meta {
    padding-top: 25px;
    border-top: 1px solid var(--light-gray);
}

.product-meta p {
    margin-bottom: 10px;
    color: var(--gray);
}

.product-meta strong {
    color: var(--dark-gray);
}

.product-description-full {
    padding: 60px 0;
    background: var(--off-white);
}

.product-description-full h2 {
    margin-bottom: 25px;
}

.product-description-full p {
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ===== Carrito de Compras ===== */
.cart-section {
    padding: 60px 0;
}

.cart-empty {
    text-align: center;
    padding: 80px 20px;
}

.cart-empty i {
    font-size: 5rem;
    color: var(--light-gray);
    margin-bottom: 25px;
}

.cart-empty h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.cart-empty p {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 30px;
}

.cart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.cart-items {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr auto;
    gap: 20px;
    padding: 20px 25px;
    background: var(--off-white);
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr auto;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid var(--light-gray);
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-product {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-product-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

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

.cart-product-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-family: var(--font-primary);
}

.cart-product-info span {
    font-size: 0.85rem;
    color: var(--gray);
}

.cart-price {
    font-weight: 600;
    color: var(--dark-gray);
}

.cart-quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: fit-content;
}

.cart-quantity button {
    width: 35px;
    height: 35px;
    background: var(--off-white);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
}

.cart-quantity button:hover {
    background: var(--primary);
    color: var(--white);
}

.cart-quantity input {
    width: 45px;
    height: 35px;
    text-align: center;
    border: none;
    font-weight: 600;
}

.cart-subtotal {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.cart-remove {
    width: 40px;
    height: 40px;
    background: var(--off-white);
    border: none;
    border-radius: var(--radius-full);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.cart-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    position: sticky;
    top: 140px;
}

.cart-summary h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
}

.cart-summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    padding-top: 15px;
    border-top: 2px solid var(--light-gray);
    margin-top: 15px;
}

.cart-summary .btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
}

.cart-summary .btn-outline {
    margin-top: 10px;
}

/* ===== Checkout ===== */
.checkout-section {
    padding: 60px 0;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.checkout-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.checkout-form h2 {
    font-size: 1.6rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.checkout-order {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    position: sticky;
    top: 140px;
}

.checkout-order h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.checkout-products {
    margin-bottom: 20px;
}

.checkout-product {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
}

.checkout-product:last-child {
    border-bottom: none;
}

.checkout-product-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

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

.checkout-product-info {
    flex: 1;
}

.checkout-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 3px;
    font-family: var(--font-primary);
}

.checkout-product-info span {
    font-size: 0.85rem;
    color: var(--gray);
}

.checkout-product-price {
    font-weight: 600;
    color: var(--primary);
}

.payment-info {
    background: var(--off-white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
}

.payment-info h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-info h4 i {
    color: var(--secondary);
}

.payment-info p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.payment-info strong {
    color: var(--dark-gray);
}

/* ===== Confirmación de Pedido ===== */
.confirmation-section {
    padding: 80px 0;
}

.confirmation-box {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 50px;
    text-align: center;
}

.confirmation-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--success);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--white);
}

.confirmation-box h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.confirmation-box .order-number {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 25px;
}

.confirmation-box p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.confirmation-details {
    background: var(--off-white);
    border-radius: var(--radius-md);
    padding: 30px;
    margin: 30px 0;
    text-align: left;
}

.confirmation-details h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.confirmation-total {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
}

.bank-info {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.bank-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: var(--white);
    padding: 15px 30px;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition-normal);
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn i {
    font-size: 1.4rem;
}

/* ===== Productos Relacionados ===== */
.related-products {
    padding: 60px 0;
    background: var(--off-white);
}

.related-products h2 {
    text-align: center;
    margin-bottom: 40px;
}

/* ===== Mensajes de Alerta ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    color: #856404;
}

.alert-info {
    background: rgba(26, 26, 26, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast i {
    font-size: 1.3rem;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--error);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .product-single-grid,
    .cart-grid,
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        position: static;
    }
    
    .cart-summary,
    .checkout-order {
        position: static;
    }
    
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cart-product {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-quantity {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .shop-filters {
        flex-direction: column;
    }
    
    .shop-categories {
        justify-content: center;
    }
    
    .shop-search {
        max-width: 100%;
    }
    
    .product-buttons {
        flex-direction: column;
    }
    
    .confirmation-box {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-main-image {
        height: 350px;
    }
}
