/* =========================================
   Custom Styles & Overrides
   Migrated from inline HTML <style> tags
   ========================================= */

/* ----------------------------------------------------
   1. Hero Slider (from index.html)
   ---------------------------------------------------- */
/* Hide text and badges on banners initially to prevent FOUC */
.hero-slide .slide-content,
.hero-slide .slide-decoration {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s, transform 0.8s ease;
}

/* Show them only when slide is active */
.hero-slide.active .slide-content,
.hero-slide.active .slide-decoration {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Horizontal Slider Setup */
.hero-slider-container {
    overflow: hidden !important;
}

.hero-slides {
    position: relative;
    /* transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important; */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    /* Removed !important to allow JS override if needed, but kept purely style-based */
    width: 100% !important;
    height: 100% !important;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    min-height: 460px;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Only active slide is visible */
.hero-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .hero-slide {
        min-height: 200px !important;
        background-size: contain !important;
        background-color: #f8f8f8;
    }

    .hero-slides {
        min-height: 200px !important;
    }

    .hero-slider-container {
        min-height: 200px !important;
    }
}

/* ----------------------------------------------------
   2. Mobile Bottom Navigation (from product.html and others)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        position: relative;
    }

    body {
        padding-bottom: 80px !important;
        /* Space for the fixed bottom nav */
    }
}

/* ----------------------------------------------------
   3. Login Page Styles (from login.html)
   ---------------------------------------------------- */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    /* Changed from center to prevent mobile keyboard cutoff */
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
    padding: 20px;
    /* Reduced padding for mobile */
    padding-top: 40px;
    /* Add top padding for spacing */
}

.login-page-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    padding: 40px;
    position: relative;
}

.login-page-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-page-header img {
    max-width: 180px;
    margin-bottom: 20px;
}

.login-page-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.login-page-header p {
    color: #666;
    font-size: 14px;
}

.back-to-home {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #00b4d8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-home:hover {
    color: #0096c7;
    transform: translateX(-3px);
}

.back-to-home svg {
    width: 16px;
    height: 16px;
}

/* Override modal styles for page version */
.login-page-container .login-modal {
    position: relative;
    transform: none;
    background: transparent;
    box-shadow: none;
    max-width: 100%;
    padding: 0;
}

.login-page-container .login-modal-close {
    display: none;
}

.login-page-container .login-modal h2 {
    text-align: center;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .login-page-container {
        padding: 30px 20px;
    }

    .login-page-header h1 {
        font-size: 24px;
    }
}


/* ----------------------------------------------------
   4. Policy Page Styles (Privacy, Terms, Shipping, Returns)
   ---------------------------------------------------- */
.policy-page {
    padding: 60px 0;
}

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

.policy-content h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.policy-content .subtitle {
    color: #666;
    margin-bottom: 40px;
}

.policy-section {
    margin-bottom: 35px;
}

.policy-section h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00b4d8;
    display: inline-block;
}

.policy-section p,
.policy-section li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

.policy-section ul {
    padding-left: 25px;
}

.highlight-box {
    background: linear-gradient(135deg, #e8f7f5 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #00b4d8;
    margin: 20px 0;
}

.highlight-box p {
    margin: 0;
    color: #333;
}

/* ----------------------------------------------------
   5. Orders Page Styles
   ---------------------------------------------------- */
.order-status.cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cancel-order-btn {
    background: transparent;
    border: 1px solid #d32f2f;
    color: #d32f2f;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-order-btn:hover {
    background: #d32f2f;
    color: white;
}


/* ----------------------------------------------------
   6. FAQ Page Styles
   ---------------------------------------------------- */
.faq-page {
    padding: 60px 0;
}

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

.faq-content h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.faq-content .subtitle {
    color: #666;
    margin-bottom: 40px;
    text-align: center;
}

.faq-category {
    margin-bottom: 40px;
}

.faq-category h2 {
    font-size: 20px;
    color: #00b4d8;
    margin-bottom: 20px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.faq-question {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    transition: background 0.3s;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    color: #00b4d8;
    transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
    content: '';
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item.active .faq-answer {
    padding: 0 20px 18px;
    max-height: 500px;
}

.faq-answer p {
    color: #555;
    line-height: 1.7;
}

/* ----------------------------------------------------
   7. Offline Page Styles
   ---------------------------------------------------- */
.offline-container {
    text-align: center;
    padding: 40px 20px;
}

.offline-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: #7CA03C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.retry-btn {
    background: #7CA03C;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:active {
    transform: scale(0.97);
}

/* ----------------------------------------------------
   8. Admin Page Styles
   ---------------------------------------------------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table th,
.order-table td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.order-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.search-bar {
    padding: 10px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.admin-login-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    color: black;
    text-align: center;
}

.admin-login-box input {
    padding: 10px;
    width: 200px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.admin-login-box button {
    padding: 10px 20px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ----------------------------------------------------
   9. Addresses Page Styles
   ---------------------------------------------------- */
.address-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.address-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    z-index: 10002;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.address-modal.active,
.address-modal-overlay.active {
    display: block;
}

.address-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-full {
    grid-column: span 2;
}

.address-form input,
.address-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.address-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.save-address-btn {
    grid-column: span 2;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c24 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.close-address-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}