/* ================= CSS VARIABLES & RESETS ================= */
:root {
    /* Brand Colors */
    --primary-green: #1B5E20; 
    --primary-light: #2E7D32; 
    --dark-green: #233329;    
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f1f8e9;     
    --border-color: #e5e7eb;
    
    /* Currency */
    --currency: 'Tk.';
    
    /* Utility */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth; 
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: #ffffff;
    overflow-x: hidden; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* Typography Utilities */
.text-green { color: var(--primary-green); }
.text-white { color: #ffffff; }
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    border: none; 
}

.btn-primary {
    position: relative;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary-green) 100%);
    color: #ffffff;
    z-index: 1;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000000;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: white;
}

/* ================= HEADER & LOGO ================= */
.site-header {
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; }
.main-logo { height: 40px; width: auto; object-fit: contain; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
    font-size: 0.95rem; font-weight: 500; color: var(--text-muted); transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary-green); }

.header-actions { display: flex; align-items: center; gap: 16px; }

.cart-btn {
    background: #fafafa; border: none; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-main); transition: var(--transition); font-size: 1.1rem;
    position: relative;
}
.cart-btn:hover { background: var(--border-color); }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); transition: var(--transition); }
.mobile-toggle:hover { color: var(--primary-green); }
.mobile-menu-header { display: none; }
.mobile-overlay { display: none; }
.mobile-only-action { display: none; }

/* ================= GLOBAL TAGS (Ribbons) ================= */
.tag {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tag-featured { background: var(--primary-green); }
.tag-new { background: #3b82f6; }
.tag-hot { background: #f59e0b; }

/* ================= PRODUCT DETAILS GALLERY (WooCommerce Style) ================= */
#img-zoom-container {
    position: relative; 
    border-radius: var(--radius-md);
    overflow: hidden; /* Crucial: Keeps the zoomed image contained inside the box */
    margin-bottom: 12px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    cursor: zoom-in; /* Shows the magnifying glass cursor */
    aspect-ratio: 1 / 1;
}

#detail-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Edge to edge */
    transition: transform 0.1s ease-out; /* Smooth snapping to cursor */
    transform-origin: center center;
    pointer-events: none; /* Let the container handle the hover events */
}

/* Professional Tight Thumbnail Grid */
.thumbnail-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 equal columns */
    gap: 12px; /* Professional tight spacing */
    margin-top: 12px;
}

.thumbnail-row .thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    background: #f3f4f6;
}

.thumbnail-row .thumb.active, .thumbnail-row .thumb:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.15);
}

/* ================= PROFESSIONAL QUANTITY SWITCHER ================= */

/* Hide the ugly native browser up/down arrows inside number inputs */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield; 
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
    background: #fff;
    margin-right: 16px; 
}

.qty-btn {
    background: transparent;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.qty-btn:hover {
    background: #f3f4f6;
    color: var(--primary-green);
}

.qty-input {
    width: 50px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    background: transparent;
    outline: none;
    padding: 12px 0;
}


/* ================= DYNAMIC SLIDE-OUT CART STYLES ================= */

.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-green);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart:hover {
    transform: scale(1.1);
    background: #000;
}

#cart-badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444; 
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.cart-drawer-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}
.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px; 
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: white;
    z-index: 1002;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}
.close-drawer-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.close-drawer-btn:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-items::-webkit-scrollbar { width: 6px; }
.drawer-items::-webkit-scrollbar-track { background: #f1f1f1; }
.drawer-items::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.cart-item-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    flex-shrink: 0;
}
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cart-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 8px;
}
.cart-item-price-remove {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.cart-item-price {
    font-weight: 800;
    color: var(--primary-green);
    font-size: 1rem;
}
.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.remove-btn:hover {
    color: #ef4444;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}
.cart-qty-controls .qty-action {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 4px;
}
.cart-qty-controls .qty-action:hover { 
    color: var(--primary-green); 
    transform: scale(1.1);
}
.cart-qty-controls .qty-amount { 
    font-size: 1rem; 
    font-weight: 700; 
    color: #1f2937;
    min-width: 16px; 
    text-align: center; 
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 40px;
}

.drawer-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}
.drawer-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}
.tax-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}


/* ================= FOOTER ================= */
.site-footer { background-color: var(--dark-green); color: white; padding: 80px 0 0 0; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 60px; margin-bottom: 60px; }
.footer-brand p { color: #a0aec0; margin: 20px 0; font-size: 0.95rem; }
.social-links { display: flex; gap: 16px; }
.social-links a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.social-links a:hover { background: var(--primary-green); border-color: var(--primary-green); transform: translateY(-3px); }
.footer-links h4, .footer-newsletter h4 { font-size: 1.1rem; margin-bottom: 24px; font-weight: 600; }
.footer-links ul { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: #a0aec0; transition: var(--transition); font-size: 0.95rem; }
.footer-links a:hover { color: white; padding-left: 5px; }
.footer-newsletter p { color: #a0aec0; font-size: 0.95rem; margin-bottom: 20px; }
.newsletter-form { display: flex; gap: 0; }
.newsletter-form input { flex: 1; padding: 12px 16px; border: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); outline: none; font-family: inherit; }
.newsletter-form button { background: var(--primary-green); color: white; border: none; padding: 0 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; transition: var(--transition); }
.newsletter-form button:hover { background: #000000; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 24px 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; color: #a0aec0; font-size: 0.9rem; }

/* ================= 100% RESPONSIVENESS ================= */
@media (max-width: 992px) {
    .mobile-toggle { display: block; }
    .desktop-sell-btn { display: none; } 
    
    .mobile-overlay {
        display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(0,0,0,0.6); z-index: 998; backdrop-filter: blur(4px);
        opacity: 0; visibility: hidden; transition: all 0.4s ease;
        pointer-events: none; 
    }
    .mobile-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }

    .main-nav {
        position: fixed; top: 0; right: -100%; width: 320px; max-width: 85vw; height: 100vh;
        background: white; z-index: 1000; padding: 24px; box-shadow: -10px 0 30px rgba(0,0,0,0.15);
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex; flex-direction: column; overflow-y: auto;
    }
    .main-nav.active { right: 0; }

    .mobile-menu-header {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color);
    }
    .mobile-close { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-main); transition: var(--transition); }
    .mobile-close:hover { color: #ef4444; transform: rotate(90deg); }

    .nav-links { flex-direction: column; gap: 8px; }
    .nav-links a { font-size: 1.1rem; display: block; padding: 12px 16px; border-radius: var(--radius-sm); background: #fafafa; }
    .nav-links a:hover, .nav-links a.active { background: #e8f5e9; color: var(--primary-green); padding-left: 24px; }
    
    .mobile-only-action { display: block; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .flex-between { flex-direction: column; gap: 16px; text-align: center; }
}