/* ============ CSS Variables ============ */
:root {
    /* Brand Colors */
    --primary: #0F8A5F;
    /* Deep Jungle Green */
    --primary-dark: #04623f;
    --primary-light: #e6f4f0;
    --accent: #FF6600;
    /* Vibrant Orange */
    --accent-hover: #e55a00;

    /* UI Colors */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Functional Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --transition: all 0.3s ease;
}

/* ============ Reset & Base ============ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ Preloader & Initial Hide ============ */
body:not(.loaded) > *:not(#hydroflow-preloader) {
    display: none !important;
}

#hydroflow-preloader {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.preloader-logo {
    width: 140px;
    height: auto;
    animation: logoPulse 1.5s ease-in-out infinite;
    margin-bottom: 25px;
}

@keyframes logoPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.preloader-bar {
    width: 200px;
    height: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.preloader-progress {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    animation: barProgress 2s linear infinite;
}

@keyframes barProgress {
    0% { left: -100%; }
    100% { left: 100%; }
}

body.loaded #hydroflow-preloader {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============ Typography ============ */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-dark);
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60%;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============ Header ============ */
.header {
    background-color: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.top-bar {
    background-color: var(--primary-dark);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-main {
    padding: 1rem 0;
}

.nav-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-wrapper {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1.25rem;
    padding-right: 3rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-actions {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-main);
    gap: 0.25rem;
    position: relative;
}

.nav-link i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-link:hover i {
    color: var(--primary);
    transform: translateY(-2px);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ============ Navigation Menu ============ */
.cat-nav {
    background-color: var(--primary);
    color: white;
}

.cat-nav .container {
    display: flex;
}

.cat-links {
    display: flex;
    overflow-x: auto;
}

.cat-link {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.cat-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--accent);
}


/* ============ Hero ============ */
.hero {
    margin: 2rem 0;
}

.hero-slider {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-slide {
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex !important;
    align-items: center;
}

.hero-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    position: absolute;
    inset: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    color: white;
    max-width: 600px;
    padding: 3rem;
}

/* ============ Cards ============ */
.grid-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2;
}

.card-img {
    height: 220px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.card-img img {
    max-height: 100%;
    transition: transform 0.5s ease;
}

.card:hover .card-img img {
    transform: scale(1.1);
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: auto;
    margin-bottom: 1rem;
}


.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* ============ Footer ============ */
.footer {
    background-color: #111827;
    color: #94a3b8;
    padding-top: 4rem;
    margin-top: 4rem;
}

/* ============ Custom Notifications (Toasts) ============ */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease forwards;
    border-left: 5px solid var(--primary);
}

.toast i {
    font-size: 1.25rem;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-success i {
    color: var(--success);
}

.toast-danger {
    border-left-color: var(--danger);
}

.toast-danger i {
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning i {
    color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-info i {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============ Custom Confirmation Modal ============ */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.custom-modal {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalScaleUp 0.3s ease;
}

@keyframes modalScaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.modal-icon-danger {
    background: #fef2f2;
    color: var(--danger);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
}


.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #1f2937;
}

.footer-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-link {
    display: block;
    margin-bottom: 0.75rem;
    color: inherit;
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
}

.footer-bottom {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* ============ Mobile ============ */
@media (max-width: 768px) {
    .nav-main .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-wrapper {
        order: 3;
        max-width: 100%;
        margin-top: 0.5rem;
    }

    .hero-slide {
        height: 250px;
    }

    .grid-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ============ Dropdown Menu ============ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    color: var(--primary-dark);
    padding: 10px 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    padding-left: 25px;
}

/* ============ WhatsApp Floating Button ============ */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    padding: 12px 15px;
    z-index: 9999;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-width: 52px;
    /* Initially show only icon */
    white-space: nowrap;
}

.whatsapp-float i {
    font-size: 26px;
}

.whatsapp-float span {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
}

.whatsapp-float:hover {
    max-width: 200px;
    /* Expand to show text */
    padding: 12px 25px;
    transform: scale(1.05);
}

.whatsapp-float:hover span {
    opacity: 1;
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
}

/* ============ Search Dropdown ============ */
.search-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 9998;
    display: none;
    padding: 15px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.search-result-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #0f8a5f;
}

.search-result-image {
    display: block;
    width: 100%;
    height: 140px;
    background: #f8f9fa;
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s;
}

.search-result-item:hover .search-result-image img {
    transform: scale(1.05);
}

.search-result-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 40px;
    text-decoration: none;
    transition: color 0.2s;
}

.search-result-name:hover {
    color: #0f8a5f;
}

.search-result-description {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;
}

.search-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 8px;
}

.search-result-name mark {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-price {
    font-size: 14px;
    color: #0f8a5f;
    font-weight: 700;
}

.search-result-button {
    padding: 6px 12px;
    background: #0f8a5f;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-result-button:hover {
    background: #04623f;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    grid-column: 1 / -1;
}

.search-no-results i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.search-no-results p {
    margin: 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .search-dropdown {
        max-height: 400px;
        padding: 10px;
    }
}