/* 
========================================
   Warafy Glass - Main Stylesheet
   Rebuilt for Cloudflare Pages
========================================
*/

:root {
    --primary: #4834d4;
    --secondary: #f0932b;
    --dark: #2d3436;
    --light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --radius: 12px;
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-body);
    background: #f1f2f6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(72, 52, 212, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(240, 147, 43, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

[hidden] { display: none !important; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
del { color: #b2bec3; font-size: 0.8em; font-weight: 400; }

/* Layout */
.container { width: 96%; max-width: 1400px; margin: 0 auto; padding: 0 15px; }

/* Glassmorphism Helper */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
}

/* Header */
.site-header { padding: 15px 0; position: sticky; top: 20px; z-index: 1000; margin-bottom: 30px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; gap: 20px; }
.site-logo img { max-height: 50px; width: auto; }

.header-search { flex: 1; max-width: 600px; margin: 0 30px; }
.search-form { width: 100%; }
.search-group { position: relative; display: flex; align-items: center; }
.search-field {
    width: 100%; padding: 12px 60px 12px 20px; border-radius: 50px; border: 2px solid #e1e1e1;
    background: rgba(255, 255, 255, 0.9); font-size: 15px; color: var(--dark);
    transition: all 0.3s ease; outline: none;
}
.search-field:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(72, 52, 212, 0.1); background: #fff; }
.search-submit {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
    border-radius: 50%; background: var(--primary); border: none; color: #fff; font-size: 16px;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.search-submit:hover { background: var(--secondary); transform: translateY(-50%) scale(1.05); }

.header-actions { display: flex; align-items: center; gap: 20px; }
.action-btn {
    display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--dark);
    font-size: 15px; background: none; border: none; cursor: pointer; padding: 6px;
}
.action-btn:hover { color: var(--primary); }
.cart-btn { position: relative; }
.cart-count {
    background: var(--secondary); color: #fff; font-size: 12px; padding: 2px 6px;
    border-radius: 10px; position: absolute; top: -8px; right: -8px; min-width: 20px; text-align: center;
}

/* Hero */
.hero-section { padding: 20px 0; }
.hero-layout { display: flex; gap: 20px; height: 450px; }

.hero-sidebar {
    width: 20%; display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.sidebar-title {
    background: var(--primary); color: #fff; padding: 15px; margin: 0; font-size: 16px;
    font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.category-list-scroll { flex: 1; overflow-y: auto; padding: 10px 0; }
.category-menu li a {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 20px;
    font-size: 14px; color: #2d3436; border-bottom: 1px solid #f1f2f6;
}
.category-menu li a i { font-size: 10px; }
.category-menu li a:hover { color: var(--primary); background: #f8f9fa; padding-left: 25px; }

.hero-slider-wrapper {
    width: 80%; position: relative; border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); background: #dfe6e9;
}
.hero-slider, .slide { height: 100%; width: 100%; }
.slide {
    position: absolute; top: 0; left: 0; background-size: cover; background-position: center;
    display: flex; align-items: center; padding: 0 80px; opacity: 0; transition: opacity 0.6s ease;
}
.slide.active { opacity: 1; z-index: 1; }
.slide-content {
    max-width: 500px; background: rgba(255, 255, 255, 0.9); padding: 40px;
    border-radius: var(--radius); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transform: translateY(30px); opacity: 0; transition: 0.6s 0.3s;
}
.slide.active .slide-content { transform: translateY(0); opacity: 1; }
.slide-content h2 {
    font-family: var(--font-heading); font-size: 36px; margin: 0 0 15px; color: var(--primary); line-height: 1.2;
}
.slide-content p { font-size: 16px; margin-bottom: 25px; color: #636e72; }
.btn-primary {
    background: var(--secondary); color: #fff; padding: 12px 30px; border-radius: 50px;
    font-weight: 600; display: inline-block; border: none; cursor: pointer;
    box-shadow: 0 5px 15px rgba(240, 147, 43, 0.4); transition: 0.3s;
}
.btn-primary:hover { background: #e67e22; transform: translateY(-2px); }

.slider-nav button {
    position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px;
    border-radius: 50%; background: rgba(255, 255, 255, 0.9); border: none; cursor: pointer;
    z-index: 10; font-size: 18px; color: var(--dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); transition: 0.3s;
}
.slider-nav button:hover { background: var(--primary); color: #fff; }
.slider-prev { left: 20px; }
.slider-next { right: 20px; }
.slider-dots {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 10;
}
.slider-dots button {
    width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.6); cursor: pointer; transition: 0.3s;
}
.slider-dots button.active { background: var(--secondary); width: 24px; border-radius: 6px; }

/* Sections */
.section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
    border-bottom: 2px solid #eee; padding-bottom: 15px; gap: 15px;
}
.section-header h2 {
    font-family: var(--font-heading); font-size: 24px; margin: 0; display: flex;
    align-items: center; gap: 10px; flex-wrap: wrap;
}
.view-all-btn {
    color: var(--primary); font-weight: 600; font-size: 14px; border: 1px solid var(--primary);
    padding: 8px 20px; border-radius: 50px; white-space: nowrap; background: transparent; cursor: pointer;
}
.view-all-btn:hover { background: var(--primary); color: #fff; }

.flash-sale-section { margin-bottom: 50px; scroll-margin-top: 130px; }
.timer { display: flex; gap: 8px; margin-left: 20px; }
.timer span {
    background: #d63031; color: #fff; padding: 4px 8px; border-radius: 4px;
    font-weight: 700; font-size: 14px; font-family: var(--font-body);
}

.categories-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px; margin-bottom: 50px;
}
.cat-card {
    background: #fff; padding: 25px; text-align: center; border-radius: var(--radius);
    transition: 0.3s; border: 1px solid #eee;
}
.cat-card:hover { transform: translateY(-10px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); border-color: var(--primary); }
.cat-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(72, 52, 212, 0.15); }
.cat-icon { font-size: 32px; color: var(--primary); margin-bottom: 15px; }
.cat-card h3 { font-size: 16px; margin: 0; color: var(--dark); }

.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px; margin-bottom: 50px;
}
.product-card {
    background: #fff; border-radius: var(--radius); overflow: hidden; transition: 0.3s;
    border: 1px solid #eee; position: relative; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); }
.product-card.hidden { display: none; }
.product-img {
    height: 220px; background: #f5f6fa; display: flex; align-items: center;
    justify-content: center; position: relative; padding: 14px;
}
.product-img img { max-height: 100%; width: auto; box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15); border-radius: 2px; }
.product-info { padding: 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-title { font-size: 15px; margin: 0; font-weight: 600; line-height: 1.4; }
.product-category { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #636e72; }
.product-price { color: var(--secondary); font-weight: 700; font-size: 18px; margin-top: auto; }
.add-to-cart {
    background: var(--primary); color: #fff; border: none; border-radius: 50px; padding: 9px 14px;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.3s;
}
.add-to-cart:hover { background: #381fa8; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 50px; color: #636e72; background: #fff; border-radius: var(--radius); }

/* Footer */
.site-footer { background: #fff; padding: 50px 0 0; margin-top: 50px; border-top: 1px solid #eee; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand img { max-height: 42px; width: auto; margin-bottom: 15px; }
.footer-brand p { color: #636e72; font-size: 14px; max-width: 300px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links h4 { font-family: var(--font-heading); margin: 0 0 8px; font-size: 16px; }
.footer-links a { color: #636e72; font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid #eee; padding: 20px 0; text-align: center; color: #636e72; font-size: 14px; margin: 0; }

/* Cart drawer */
.cart-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 2000; }
.cart-drawer {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(400px, 100%);
    background: #fff; z-index: 2001; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    display: flex; flex-direction: column; animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.cart-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid #eee;
}
.cart-drawer-header h3 { margin: 0; font-family: var(--font-heading); font-size: 18px; }
.cart-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: #636e72; }
.cart-close:hover { color: var(--primary); }
.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-item { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #eee; }
.cart-item img { width: 46px; height: 64px; object-fit: cover; }
.cart-item-details { flex: 1; }
.cart-item-details h4 { margin: 0 0 4px; font-size: 14px; }
.cart-item-details p { margin: 0; color: var(--secondary); font-weight: 700; font-size: 14px; }
.cart-item .remove-item { background: none; border: none; color: #b2bec3; cursor: pointer; font-size: 16px; }
.cart-item .remove-item:hover { color: #d63031; }
.cart-empty { text-align: center; color: #636e72; margin-top: 60px; }
.cart-empty i { font-size: 42px; color: #dfe6e9; margin-bottom: 12px; }
.cart-drawer-footer { padding: 20px 24px; border-top: 1px solid #eee; }
.cart-total { font-size: 18px; font-weight: 700; margin-bottom: 15px; }
.cart-checkout { width: 100%; text-align: center; }

/* Modal + toast */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-dialog { position: relative; width: min(420px, 100%); padding: 32px; background: #fff; }
.modal-dialog h3 { font-family: var(--font-heading); margin: 0 0 10px; }
.modal-dialog .modal-close { position: absolute; top: 12px; right: 16px; }
.modal-note { color: #636e72; font-size: 13px; line-height: 1.5; }
.modal-dialog form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.modal-dialog label { font-size: 13px; font-weight: 600; }
.modal-dialog input { padding: 12px 14px; border: 2px solid #e1e1e1; border-radius: 8px; outline: none; }
.modal-dialog input:focus { border-color: var(--primary); }
.modal-dialog .btn-primary { text-align: center; }
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 20px); z-index: 3000;
    background: var(--dark); color: #fff; padding: 12px 22px; border-radius: 50px;
    font-size: 14px; opacity: 0; pointer-events: none; transition: 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 991px) {
    .site-header { top: 8px; }
    .header-inner { flex-wrap: wrap; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 5px 0 0; }
    .hero-layout { flex-direction: column; height: auto; }
    .hero-sidebar { display: none; }
    .hero-slider-wrapper { width: 100%; height: 320px; }
    .slide { padding: 0 40px; }
    .slide-content { padding: 22px; }
    .slide-content h2 { font-size: 26px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .hero-slider-wrapper { height: 280px; }
    .slide { padding: 0 20px; }
    .slide-content { padding: 18px; }
    .slide-content h2 { font-size: 22px; }
    .slide-content p { font-size: 14px; margin-bottom: 16px; }
    .slider-nav button { width: 38px; height: 38px; }
    .slider-prev { left: 10px; }
    .slider-next { right: 10px; }
    .section-header h2 { font-size: 20px; }
    .timer { margin-left: 0; }
    .footer-inner { grid-template-columns: 1fr; gap: 25px; }
    .header-actions { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
