/* ===================================
   DaniDeals - Modern Layout Update
   Theme: Deep Indigo & Lively Coral
   font-family: 'Inter', system-ui, sans-serif
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary-color: #4F46E5;       /* Indigo 600 */
    --primary-dark: #4338ca;        /* Indigo 700 */
    --primary-light: #818cf8;       /* Indigo 400 */
    
    --secondary-color: #0f172a;     /* Slate 900 */
    
    --accent-color: #F43F5E;        /* Rose 500 */
    --accent-hover: #e11d48;        /* Rose 600 */
    
    /* Semantic Colors */
    --success-color: #10B981;       /* Emerald 500 */
    --warning-color: #F59E0B;       /* Amber 500 */
    --danger-color: #EF4444;        /* Red 500 */
    
    /* Backgrounds */
    --bg-body: #F3F4F6;             /* Gray 100 */
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    
    /* Text */
    --text-main: #1F2937;           /* Gray 800 */
    --text-muted: #6B7280;          /* Gray 500 */
    --text-light: #9CA3AF;          /* Gray 400 */
    --text-white: #FFFFFF;
    
    /* Borders & Shadows */
    --border-color: #E5E7EB;        /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

/* ===================================
   LAYOUT & CONTAINER
   =================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===================================
   HEADER
   =================================== */

header {
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Top Bar - Simplified */
.header-top {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.header-top p { margin: 0; }

/* Main Header Content */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

/* Logo Update */
.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Modern Search Bar */
.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-bar form {
    display: flex;
    background: var(--bg-body);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.2s;
}

.search-bar form:focus-within {
    background: var(--bg-surface);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
}

.search-bar button {
    padding: 0 1.5rem;
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.search-bar button:hover {
    color: var(--primary-dark);
}

.search-suggestions {
    display: none; /* Toggled by JS */
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color);
    border-top: none; 
    border-radius: 0 0 var(--radius-lg) var(--radius-lg); 
    box-shadow: var(--shadow-lg); 
    z-index: 1000; 
    max-height: 400px; 
    overflow-y: auto;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.header-actions a:hover {
    background-color: var(--bg-body);
    color: var(--primary-color);
}

.favorites-link i {
    color: var(--accent-color);
}

#fav-count {
    background: var(--danger-color);
    color: white;
    border-radius: 9999px; /* Pill/Circle */
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* ===================================
   NAVIGATION
   =================================== */

nav {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.nav-menu::-webkit-scrollbar { display: none; } /* Safari/Chrome */

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-menu li a:hover {
    color: var(--primary-color);
}

.nav-menu li a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1e1b4b 100%);
    color: var(--text-white);
    padding: 4rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Abstract Background Shapes */
.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: rgba(244, 63, 94, 0.2);
    filter: blur(80px);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 400px;
    height: 400px;
    background: rgba(79, 70, 229, 0.2);
    filter: blur(100px);
    border-radius: 50%;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: #e0e7ff;
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================
   PRODUCT GRID & CARDS
   =================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-image {
    position: relative;
    padding-top: 100%; /* Square Aspect Ratio */
    background-color: white;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center and cover/contain properly */
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Badges */
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.7) !important; /* Force override inline styles */
    backdrop-filter: blur(8px);
    color: var(--danger-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.5);
}

/* Favorite Button */
.fav-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 20;
    font-size: 1.1rem;
    
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fav-btn:hover {
    color: var(--accent-color);
    background: white;
    box-shadow: var(--shadow-md);
}

.product-card:hover .fav-btn {
    opacity: 1;
    transform: translateY(0);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-actions {
    margin-top: auto;
}

.product-category a {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0.5rem 0 1rem;
    flex-grow: 1;
}

.product-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    text-align: center;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    text-decoration: none;
    display: block;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

/* ===================================
   SECTION HEADERS
   =================================== */

.section-header {
    margin: 3rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--accent-color);
}

.section-header a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* ===================================
   PAGINATION
   =================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination span.active {
    background-color: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* ===================================
   BREADCRUMB
   =================================== */
.breadcrumb {
    padding: 1rem 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.breadcrumb ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    opacity: 0.5;
}
.breadcrumb a { color: var(--text-main); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-color); }

/* ===================================
   PRODUCT DETAIL
   =================================== */
.product-detail {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin: 2rem 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media(min-width: 768px) {
    .product-detail-content { grid-template-columns: 1fr 1fr; }
}

.product-detail-image img {
    width: 100%;
    margin: 0 auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.product-detail-info h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.detail-current-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.detail-original-price {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 1rem;
}

.product-detail-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.product-detail-actions .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    flex: 1;
}

/* Coupon Box */
.product-detail-coupon {
    background: #eef2ff; /* indigo-50 */
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.coupon-code-large {
    font-family: monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    display: block;
    letter-spacing: 2px;
}

/* ===================================
   FILTERS
   =================================== */
.filters-section {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}
.filters-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.filters-content { display: flex; gap: 1rem; flex-wrap: wrap; }
.filter-group select, .filter-group input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

/* ===================================
   FOOTER
   =================================== */

footer {
    background-color: var(--secondary-color);
    color: #cbd5e1;
    padding-top: 5rem;
    margin-top: 5rem;
    border-top: 5px solid var(--primary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media(min-width: 768px) {
    .footer-content { grid-template-columns: repeat(4, 1fr); }
}

.footer-section h3 {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.75rem; }
.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-section a:hover { color: var(--primary-color); }

.social-links { display: flex; gap: 1rem; }
.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-3px);
}

.footer-bottom {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.875rem;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav-menu {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .search-bar {
        order: 3;
        min-width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

/* Timer Styles */
.timer-container {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
    border: 1px solid #ffc9c9;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.timer-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--danger-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}
.countdown-box {
    display: flex;
    gap: 0.5rem;
}
.time-unit {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    min-width: 50px;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
    transition: transform 0.2s;
}
.time-unit:hover {
    transform: translateY(-2px);
}
.time-val {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.time-txt {
    font-size: 0.65rem;
    opacity: 0.9;
    text-transform: uppercase;
    margin-top: 2px;
    font-weight: 500;
}
