/* ======================
   COMPONENTS - Products, Modals, Badge, Buttons, Notifications
   El Templo Web Catalog
   ====================== */

/* PRODUCTS GRID */
.products-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0;
}

.product-card {
    background-color: var(--color-surface);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: background-color 0.2s;
    min-height: 80px;
}

.product-card:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.product-card:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    border-bottom: none;
}

.product-card:active {
    background-color: rgba(201, 168, 106, 0.05);
}

.product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.3;
    margin-bottom: 2px;
}

.product-description {
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-description::before {
    content: "•";
    color: var(--color-primary);
    font-weight: bold;
}

.product-price-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.btn-order {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #000000;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
    touch-action: manipulation;
    box-shadow: 0 2px 6px rgba(201, 168, 106, 0.3);
    white-space: nowrap;
}

.btn-order:active {
    background: var(--color-primary-dark);
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(201, 168, 106, 0.3);
}

/* CART BADGE */
.cart-badge {
    background: linear-gradient(135deg, var(--color-gold) 0%, #B89860 100%);
    color: var(--color-dark);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(201, 168, 106, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    touch-action: manipulation;
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-height: 64px;
}

.cart-badge:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(201, 168, 106, 0.7);
}

.cart-badge:active {
    transform: translateY(-1px) scale(0.98);
}

.cart-badge.hidden {
    display: none;
}

.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.cart-icon svg {
    width: 26px;
    height: 26px;
    color: var(--color-dark);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.cart-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-heading);
}

.cart-count {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
}

.cart-count::after {
    content: ' un.';
}

.cart-total {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* WHATSAPP BUTTON */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
    min-height: 64px;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.btn-whatsapp::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-whatsapp:hover::before {
    left: 100%;
}

.btn-whatsapp:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.7);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn-whatsapp:active {
    transform: translateY(-1px) scale(0.98);
}

.whatsapp-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-icon svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* NOTIFICATIONS */
.notification {
    position: fixed;
    top: 80px;
    right: 16px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
    color: #F5F5F5;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    z-index: 10003;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border: 2px solid;
    backdrop-filter: blur(8px);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-color: var(--color-success);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.notification-error {
    border-color: #dc2626;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.notification-info {
    border-color: var(--color-gold);
    box-shadow: 0 8px 24px rgba(201, 168, 106, 0.3);
}

/* MODAL BASE */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10001;
}

.modal-content {
    position: relative;
    background: var(--color-dark);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    z-index: 10002;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 2px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.1);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-gold);
    margin: 0;
}

.modal-close {
    background: rgba(201, 168, 106, 0.2);
    border: 1px solid var(--color-gold);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: var(--color-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-gold);
    color: var(--color-dark);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--spacing-lg);
    background: var(--color-dark);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 2px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.05);
}

/* ADD TO CART MODAL */
.product-info-modal {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(201, 168, 106, 0.15);
    border: 1px solid rgba(201, 168, 106, 0.3);
    border-radius: var(--radius-md);
}

.modal-product-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #F5F5F5;
    margin: 0 0 var(--spacing-xs) 0;
}

.modal-product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-gold);
    margin: 0;
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quantity-selector label {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: #F5F5F5;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-gold);
    background: rgba(201, 168, 106, 0.1);
    color: var(--color-gold);
    font-size: 20px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--color-gold);
    color: var(--color-dark);
}

.quantity-btn:active {
    transform: scale(0.95);
}

#quantityInput {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    padding: 10px;
    border: 2px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.05);
    color: #F5F5F5;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
}

#quantityInput:focus {
    outline: none;
    border-color: var(--color-gold);
    background: rgba(201, 168, 106, 0.1);
}

.quantity-hint {
    font-size: 12px;
    color: #A0A0A0;
}

/* CONFIRM MODAL */
.modal-confirm {
    max-width: 400px;
}

.confirm-message {
    font-size: 16px;
    color: #d1d5db;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* CART MODAL */
.modal-cart {
    max-width: 600px;
}

.customer-name-section {
    margin-bottom: var(--spacing-lg);
}

.customer-name-section label {
    display: block;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
}

.customer-name-section label .required {
    color: #ef4444;
    font-weight: 800;
}

#customerNameInput {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.05);
    color: #F5F5F5;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    transition: all 0.2s;
}

#customerNameInput::placeholder {
    color: #6b7280;
}

#customerNameInput:focus {
    outline: none;
    border-color: var(--color-gold);
    background: rgba(201, 168, 106, 0.1);
    box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.1);
}

#customerNameInput.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: shake 0.5s;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(201, 168, 106, 0.1);
    border: 1px solid rgba(201, 168, 106, 0.2);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.cart-item:hover {
    background: rgba(201, 168, 106, 0.15);
    border-color: rgba(201, 168, 106, 0.3);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #F5F5F5;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 12px;
    color: #A0A0A0;
    margin: 0;
}

.cart-item-subtotal {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-gold);
    white-space: nowrap;
    margin-left: var(--spacing-sm);
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-quantity button {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.1);
    color: var(--color-gold);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
}

.cart-item-quantity button:hover:not(:disabled) {
    border-color: var(--color-gold);
    background: rgba(201, 168, 106, 0.2);
    transform: scale(1.05);
}

.cart-item-quantity button:active:not(:disabled) {
    transform: scale(0.95);
}

.cart-item-quantity button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cart-item-quantity input {
    width: 55px;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid rgba(201, 168, 106, 0.3);
    background: rgba(201, 168, 106, 0.05);
    color: #F5F5F5;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-heading);
}

.cart-item-quantity input:focus {
    outline: none;
    border-color: var(--color-gold);
    background: rgba(201, 168, 106, 0.1);
}

.cart-item-remove {
    background: rgba(220, 38, 38, 0.15);
    border: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    touch-action: manipulation;
    white-space: nowrap;
}

.cart-item-remove:hover {
    background: rgba(220, 38, 38, 0.25);
    border-color: #dc2626;
    color: #ff5555;
    transform: scale(1.05);
}

.cart-item-remove:active {
    transform: scale(0.95);
}

.cart-total-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-gold) 0%, #B89860 100%);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 12px rgba(201, 168, 106, 0.3);
}

.total-label {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-dark);
}

.total-amount {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-dark);
}

.modal-footer-cart {
    flex-wrap: wrap;
}

/* BUTTONS */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border: 2px solid;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--color-gold);
    color: var(--color-dark);
    border-color: var(--color-gold);
    box-shadow: 0 2px 8px rgba(201, 168, 106, 0.3);
}

.btn-primary:hover {
    background: #D4B97A;
    border-color: #D4B97A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 168, 106, 0.4);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: rgba(201, 168, 106, 0.1);
    color: #F5F5F5;
    border-color: rgba(201, 168, 106, 0.3);
}

.btn-secondary:hover {
    background: rgba(201, 168, 106, 0.2);
    border-color: rgba(201, 168, 106, 0.5);
}

.btn-success {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-success:disabled {
    background: rgba(201, 168, 106, 0.1);
    color: #6b7280;
    border-color: rgba(201, 168, 106, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border-color: rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
    color: #dc2626;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* EMPTY STATES */
.empty-cart-message {
    text-align: center;
    padding: var(--spacing-xl);
    color: #A0A0A0;
}

.empty-cart-message .empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-cart-message p {
    font-size: 16px;
    margin: 0;
    color: #A0A0A0;
}

/* RESPONSIVE */
@media (min-width: 640px) {
    .product-card {
        padding: var(--spacing-lg);
        min-height: 90px;
    }
    
    .product-name {
        font-size: 17px;
    }
    
    .product-description {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .btn-order {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .cart-badge {
        padding: 18px 24px;
        min-height: 64px;
    }
    
    .cart-icon {
        width: 30px;
        height: 30px;
    }
    
    .cart-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .cart-count {
        font-size: 16px;
    }
    
    .cart-total {
        font-size: 24px;
    }
    
    .btn-whatsapp {
        padding: 18px 40px;
        font-size: 20px;
        min-height: 64px;
    }
    
    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }
    
    .whatsapp-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .notification {
        top: 90px;
        right: 20px;
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .product-card:hover {
        background-color: rgba(201, 168, 106, 0.08);
    }
    
    .btn-order:hover {
        background: var(--color-primary-dark);
        transform: scale(1.05);
    }
}
