/* encantos.css - Refined & Distinguished Theme */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

/* Header - Slim Black Band */
header {
    background: #000000;
    color: white;
    padding: 0.75rem 0;
    text-align: center;
    border-bottom: 1px solid #333;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo {
    font-size: 1.2rem;
}

.store-name {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content p {
    font-size: 0.95rem;
    margin-top: 5px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Peru Flag Emoji */
.hero-content p::after {
    content: '🇵🇪';
    font-size: 1.1rem;
}

/* Search Bar - Clean & Minimal */
.search-container {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 99;
    transition: all 0.3s ease;
}

.search-container.scrolled {
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: #000000;
}

.search-bar button {
    display: none; /* Hide search button */
}

/* Products Grid */
.products-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #1a1a1a;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: #000000;
    margin: 12px auto;
}

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

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-image {
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid #e5e5e5;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.product-description {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Ingredients Accordion */
.ingredients-accordion {
    margin-bottom: 15px;
    border-top: 1px solid #e5e5e5;
    padding-top: 12px;
}

.ingredients-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.3s;
    user-select: none;
}

.ingredients-header:hover {
    color: #000000;
}

.ingredients-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredients-icon {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s;
}

.ingredients-icon.open {
    transform: rotate(180deg);
}

.ingredients-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.6;
}

.ingredients-content.open {
    max-height: 300px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: #f5f5f5;
    border-color: #000000;
}

.quantity-input {
    width: 50px;
    text-align: center;
    margin: 0 10px;
    padding: 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 1rem;
}

/* Add to Cart Button - Premium Black Outline */
.add-to-cart {
    width: 100%;
    padding: 14px;
    background: white;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
}

.add-to-cart:hover {
    background: #000000;
    color: white;
}

/* Active state for mobile touch */
.add-to-cart:active {
    background: #000000;
    color: white;
    transform: scale(0.98);
}

/* Support for touch devices */
@media (hover: none) and (pointer: coarse) {
    .add-to-cart:active {
        background: #000000;
        color: white;
    }
}

/* Floating Cart Button */
.cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #000000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

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

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.4s ease-in-out;
    z-index: 99999;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

.cart-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-cart:hover {
    color: #000000;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    border: 1px solid #e5e5e5;
}

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

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1a1a1a;
}

.cart-item-price {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-quantity label {
    font-size: 0.9rem;
    color: #666;
}

.cart-item-quantity-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
}

.remove-item {
    color: #ff4757;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 5px;
    transition: color 0.3s;
    text-decoration: underline;
}

.remove-item:hover {
    color: #e63946;
}

.cart-summary {
    padding: 20px;
    border-top: 2px solid #e5e5e5;
    background: #f9f9f9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Checkout Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.open {
    visibility: visible;
    opacity: 1;
}

.checkout-modal {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s;
    overflow-y: auto;
    margin: auto;
}

.modal-overlay.open .checkout-modal {
    transform: translateY(0);
}

.modal-header {
    margin-bottom: 25px;
    text-align: center;
}

.modal-title {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-subtitle {
    color: #666;
    font-size: 0.95rem;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: #000000;
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.cancel-btn {
    padding: 14px 25px;
    background: white;
    color: #000000;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.cancel-btn:hover {
    border-color: #000000;
    background: #f5f5f5;
}

.submit-order {
    padding: 14px 25px;
    background: #128C7E; //#25D366;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.submit-order i {
    margin-right: 8px;
}

.submit-order:hover {
    background: #128C7E;
}

.submit-order:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Footer */
.footer {
    background: #000000;
    color: white;
    padding: 2.5rem 1rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: white;
    color: #000000;
    transform: translateY(-3px);
}

.social-link i {
    font-size: 1.2rem;
}

.copyright {
    margin-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.store-name-footer {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.footer-tagline {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* Utility Classes */
.no-results {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 3rem;
    grid-column: 1 / -1;
}

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

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notification Styles - Top Position */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: white;
    padding: 14px 28px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-weight: 500;
    animation: slideDown 0.3s ease-out, slideUp 0.3s ease-out 2.7s forwards;
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

@keyframes slideUp {
    from { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .cart-sidebar {
        width: 320px;
    }
    
    .store-name {
        font-size: 1.2rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .footer {
        padding: 2rem 1rem;
    }
    
    .social-links {
        gap: 1rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link i {
        font-size: 1rem;
    }

    .notification {
        top: 70px;
        max-width: 90%;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .search-bar input {
        border-radius: 4px;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    
    .checkout-modal {
        max-height: 95vh;
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .cancel-btn, .submit-order {
        width: 100%;
    }

    .notification {
        top: 60px;
        font-size: 0.9rem;
    }
}

@media (max-height: 700px) {
    .checkout-modal {
        max-height: 95vh;
    }
    
    .modal-overlay {
        align-items: flex-start;
    }
}

/* Print Styles */
@media print {
    .cart-btn,
    .search-container,
    .footer,
    .modal-overlay,
    .notification {
        display: none !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card {
        break-inside: avoid;
    }
}
