/* Enhanced Main Page Styles - Mobile-First Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Loading Splash */
.loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-splash.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

.loading-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #8B4513;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Navigation Buttons */
.nav-btn {
    background: #f5f5f5;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: #e0e0e0;
    color: #8B4513;
    transform: translateY(-1px);
}

.language-btn span {
    position: relative;
    min-width: 50px;
}

.language-btn svg {
    width: 20px;
    height: 20px;
}

.language-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #8B4513;
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 6px;
    min-width: 16px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-transform: uppercase;
}

.language-btn:hover .language-indicator {
    background: #A0522D;
}

[dir="rtl"] .language-indicator {
    right: auto;
    left: -5px;
}

.language-btn.switching {
    animation: languageSwitch 0.3s ease;
}

@keyframes languageSwitch {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
}

.admin-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 140px 0 80px;
    text-align: center;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    background: #fff;
    color: #8B4513;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* Products Section */
.products-section {
    padding: 4rem 0;
    background: #fafafa;
}

.products-header {
    margin-bottom: 1rem;
    text-align: center;
}

.products-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}

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

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
    position: relative;
}

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

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

.product-info {
    padding: 1.5rem;
}

.product-brand {
    color: #8B4513;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
    line-height: 1.4;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #8B4513;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    border-color: #8B4513;
    color: #8B4513;
}

.pagination-btn.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.75rem 0.5rem;
    color: #666;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.empty-state p {
    color: #666;
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background: white;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.about-content p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 3rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
}

.feature-icon {
    font-size: 2rem;
    margin-top: 0.25rem;
}

.feature h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

/* Reviews Section */
.reviews-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.reviews-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 3rem;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.review-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.review-stars {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.review-card p {
    color: #555;
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.review-author strong {
    color: #333;
    font-weight: 600;
}

.review-author span {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    border-radius: 16px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0,0,0,0.2);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
}

.product-image-modal {
    width: 100%;
    height: 400px;
    background: #ffffff; 
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    overflow: hidden; 
}

.product-image-modal img {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    border-radius: 15px; 
}

.product-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-details h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-details p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.variant-selection h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
}

.variant-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.variant-btn {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.variant-btn:hover {
    border-color: #8B4513;
}

.variant-btn.selected {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

.variant-btn.whole-bottle {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #666;
    border-style: dashed;
}

/* Quantity Section */
.quantity-section {
    margin: 1.5rem 0;
}

.quantity-section h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #8B4513;
    background: white;
    color: #8B4513;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #8B4513;
    color: white;
    transform: translateY(-1px);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background: white;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* Remove spinner arrows */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 3000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.cart-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-sidebar-header h3 {
    font-size: 1.2rem;
    color: #333;
}

.close-sidebar {
    width: 43px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-sidebar:hover {
    background: #e0e0e0;
}

.cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

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

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

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cart-item-variant {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.qty-btn:hover {
    background: #e0e0e0;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.25rem;
    font-size: 0.8rem;
}

.cart-item-price {
    font-weight: 600;
    color: #8B4513;
    font-size: 0.9rem;
    text-align: right;
    margin-left: 1rem;
}

.cart-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-total {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.cart-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.3);
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Floating Buttons */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1500;
}

.whatsapp-float,
.scroll-top-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: none;
    cursor: pointer;
}

.whatsapp-float {
    background: #25d366;
    color: white;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.scroll-top-btn {
    background: #8B4513;
    color: white;
}

.scroll-top-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(139, 69, 19, 0.4);
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #8B4513;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
}

.social-links,
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link,
.footer-links a {
    color: #ccc;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.social-link:hover,
.footer-links a:hover {
    color: #8B4513;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .nav-container {
        padding: 0.75rem;
        flex-wrap: wrap;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .modal-body {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .product-image-modal {
        min-height: 250px;
        padding: 1rem;
    }

    .product-details {
        padding: 1.5rem;
        gap: 1rem;
    }

    .product-details h2 {
        font-size: 1.5rem;
    }

    .variant-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .quantity-controls {
        gap: 0.75rem;
    }

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

    .about-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }

    .whatsapp-float,
    .scroll-top-btn {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .pagination-container {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* RTL Support */
[dir="rtl"] .cart-count {
    right: auto;
    left: -5px;
}

[dir="rtl"] .cart-sidebar {
    right: auto;
    left: -400px;
}

[dir="rtl"] .cart-sidebar.open {
    left: 0;
}

[dir="rtl"] .floating-buttons {
    right: auto;
    left: 2rem;
}

@media (max-width: 768px) {
    [dir="rtl"] .cart-sidebar {
        left: -100%;
    }
    
    [dir="rtl"] .floating-buttons {
        left: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Additional Styles for Cart Items */
.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
}

.remove-item-btn:hover {
    color: red;
}

/* Logo Image Styles */
.loading-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Makes it white for dark background */
}

.header-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.empty-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.5;
}

.footer-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(25deg); /* Makes it brown */
}

/* Additional Logo Styles for JavaScript-generated content */
.cart-empty-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.5;
}

.fallback-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.product-fallback-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Search and Filter Section - FIXED */
.search-filter-section {
    max-width: 800px;
    margin: 2rem auto 0;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-container {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: white;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-clear-btn:hover {
    background: #f0f0f0;
    color: #8B4513;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.sort-select,
.items-per-page-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
}

.sort-select:focus,
.items-per-page-select:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.search-results-info {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
}

#searchTermDisplay {
    font-weight: 600;
    color: #8B4513;
}

/* RTL Support for Search */
[dir="rtl"] .search-icon {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .search-clear-btn {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .search-input {
    padding: 1rem 3rem 1rem 3rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-filter-section {
        margin: 1.5rem auto 0;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-select,
    .items-per-page-select {
        min-width: auto;
        max-width: none;
        flex: none;
    }
    
    .search-input {
        padding: 0.875rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .search-icon {
        left: 0.75rem;
    }
    
    .search-clear-btn {
        right: 0.75rem;
    }
    
    [dir="rtl"] .search-icon {
        right: 0.75rem;
        left: auto;
    }
    
    [dir="rtl"] .search-clear-btn {
        left: 0.75rem;
        right: auto;
    }
}

@media (max-width: 480px) {
    .search-filter-section {
        margin: 1rem auto 0;
        padding: 1rem;
    }
    
    .search-input-wrapper {
        max-width: none;
    }
}

/* USER AUTH */
/* User Profile Styles */
.user-profile-dropdown {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #8B4513;
}

.user-name {
    font-weight: 600;
    color: #333;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.user-profile-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.logout-btn {
    border-top: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    padding-top: 1rem;
    color: #dc3545;
}

.logout-btn:hover {
    background: #fff5f5;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-dropdown-menu {
        right: -50px;
        min-width: 180px;
    }
}

/* USER SIDE */
/* User Profile Styles */
.user-profile-dropdown {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
    color: #666;
}

.user-profile-btn:hover {
    background: #e0e0e0;
    color: #8B4513;
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #8B4513;
    background: #f0f0f0;
}

.user-name {
    font-weight: 600;
    color: inherit;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none; /* Hide on mobile by default */
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    display: none; /* Hide on mobile by default */
}

.user-profile-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.logout-btn {
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    padding-top: 12px;
    color: #dc3545;
}

.logout-btn:hover {
    background: #fff5f5;
}

.logout-btn svg {
    color: #dc3545;
}

/* Login button styles */
.login-btn {
    background: #f5f5f5;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
    gap: 0.5rem;
}

.login-btn:hover {
    background: #e0e0e0;
    color: #8B4513;
    transform: translateY(-1px);
}

.login-btn span {
    display: none; /* Hide text on mobile */
}

/* Desktop styles */
@media (min-width: 769px) {
    .user-name {
        display: block;
    }
    
    .dropdown-arrow {
        display: block;
    }
    
    .login-btn span {
        display: inline;
    }
    
    .user-profile-btn {
        min-width: auto;
        width: auto;
    }
    
    .login-btn {
        min-width: auto;
        width: auto;
    }
}

/* RTL support for dropdown */
body[dir="rtl"] .user-dropdown-menu {
    right: auto;
    left: 0;
}

body[dir="rtl"] .dropdown-item {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="rtl"] .user-profile-btn {
    flex-direction: row-reverse;
}

/* Animation for profile picture loading */
.user-avatar {
    transition: opacity 0.3s ease;
}

.user-avatar[src=""] {
    opacity: 0;
}

/* Ensure dropdown stays within viewport */
@media (max-width: 768px) {
    .user-dropdown-menu {
        right: -20px;
        min-width: 180px;
    }
    
    body[dir="rtl"] .user-dropdown-menu {
        left: -20px;
        right: auto;
    }
}

/* Logout Modal Styles - Add to enhanced-style.css and user-auth-style.css */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

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

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: #856404;
    font-size: 24px;
}

.modal-icon.danger {
    background: #f8d7da;
    color: #721c24;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.modal-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Modal Content */
.modal-content {
    padding: 1.5rem 2rem;
}

.modal-message {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-warning.danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 0 2rem 2rem 2rem;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.modal-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.modal-btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.modal-btn-primary {
    background: #8B4513;
    color: white;
}

.modal-btn-primary:hover {
    background: #704020;
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: #dc3545;
    color: white;
}

.modal-btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Button Spinner */
.modal-btn .button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .modal-container {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-content {
        padding: 1rem 1.5rem;
    }
    
    .modal-actions {
        padding: 0 1.5rem 1.5rem 1.5rem;
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}