/*
Paul Cafe Premium Theme
Modern, Minimalist, Glassmorphism
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
--primary-color:
#ba3636;
--primary-light:
#ba363633;
--accent-color: #ff4757;

--bg-body: #f8f9fa;
--bg-surface: #ffffff;
--bg-glass: rgba(255, 255, 255, 0.85);

--text-main: #2d3436;
--text-secondary: #636e72;
--text-muted: #b2bec3;

--border-color: #dfe6e9;
--shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
--shadow-hover: 0 20px 50px -10px rgba(0,0,0,0.12);

--radius-sm: 12px;
--radius-md: 20px;
--radius-lg: 30px;

--font-main: 'Poppins';
--header-height: 70px;
}

[data-theme='dark'] {
--bg-body: #121212;
--bg-surface: #1e1e1e;
--bg-glass: rgba(30, 30, 30, 0.85);

--text-main: #dfe6e9;
--text-secondary: #b2bec3;
--text-muted: #636e72;

--border-color: #2d3436;
--shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.5);
--shadow-hover: 0 20px 50px -10px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
font-family: var(--font-main);
background-color: var(--bg-body);
color: var(--text-main);
line-height: 1.6;
font-size: 16px;
transition: background-color 0.3s ease, color 0.3s ease;
padding-bottom: 80px;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.app-header {
background: var(--bg-glass);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border-color);
position: sticky;
top: 0;
left: 0;
width: 100%;
z-index: 1000;
height: var(--header-height);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand-logo img { height: 40px; }
/* Header Actions & Theme Toggle */
.header-actions { display: flex; align-items: center; gap: 12px; }

.action-btn, .theme-toggle {
width: 42px; height: 42px;
border-radius: 12px;
background: var(--bg-surface);
border: 1px solid var(--border-color);
display: flex; align-items: center; justify-content: center;
color: var(--text-main);
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: var(--shadow-sm);
}

.action-btn:hover, .theme-toggle:hover {
background: var(--primary-color);
color: #fff;
border-color: var(--primary-color);
transform: translateY(-2px);
box-shadow: var(--shadow-soft);
}

.theme-toggle i {
transition: transform 0.5s;
}

[data-theme="dark"] .theme-toggle i {
content: "\f185"; /* Switch to sun icon content if using fontawesome unicode, or just rotate */
transform: rotate(360deg);
}
[data-theme="dark"] .theme-toggle i::before {
content: "\f185"; /* Sun icon */
}

/* Hero Slider */
.hero-section { padding: 20px 0; overflow: hidden; position: relative; }
.hero-slider { margin-bottom: 0; }
.hero-slider .slick-slide {
padding: 0 10px;
outline: none;
transition: transform 0.3s;
}
/* Scale up active slide slightly or normal */
.hero-card {
border-radius: 15px; /* Use explicit px to match img */
overflow: hidden;
position: relative;
aspect-ratio: 16/9;
/* removed shadow to avoid corner artifacts per user report */
background: transparent;
transform: translateZ(0); /* Fix for corner masking in some browsers */
}
.hero-card img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 15px; /* Double bind for safety */
}

/* Hero Dots Fix */
.hero-slider .slick-dots {
bottom: 15px; /* Lift up from very bottom edge */
width: 100%;
margin: 0;
list-style: none;
text-align: center;
position: absolute;
z-index: 10;
}
.hero-slider .slick-dots li {
display: inline-block;
margin: 0 4px;
}
.hero-slider .slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 8px; /* Smaller, cleaner */
height: 8px;
padding: 0;
cursor: pointer;
border: none;
outline: none;
background: rgba(255,255,255,0.4);
border-radius: 50%;
transition: all 0.3s;
}
.hero-slider .slick-dots li.slick-active button {
background: #fff;
transform: scale(1.3);
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Utilities */
.border-left-primary {
border-left: 4px solid var(--primary-color);
padding-left: 10px;
line-height: 1;
}

/* Slider Spacing */
/* Slider Spacing */
.trend-slider {
display: block; /* Critical for slick */
margin-right: -15px; /* Counteract padding if needed */
}
.trend-slider .slick-slide {
padding-right: 15px; /* Spacing between slides */
}
.trend-slider .product-card {
box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Lighter shadow for slider */
border: 1px solid rgba(0,0,0,0.03);
}

/* Ensure header is full width */
.app-header {
width: 100%;
left: 0;
right: 0;
}

/* Categories */
.categories-section { padding: 15px 0 30px; }
.category-scroll {
display: flex;
gap: 12px;
overflow-x: auto;
padding: 5px 20px 20px;
margin: 0 -15px;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
width: calc(100% + 30px);
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-item {
flex: 0 0 auto;
display: flex; flex-direction: column; align-items: center; gap: 8px;
cursor: pointer;
width: 85px;
text-decoration: none !important;
}

.cat-item .cat-icon {
width: 75px; height: 75px; border-radius: 22px;
background: var(--bg-surface);
border: 1px solid var(--border-color);
box-shadow: 0 4px 10px rgba(0,0,0,0.05);
display: flex; align-items: center; justify-content: center;
overflow: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cat-item .cat-icon img { width: 100%; height: 100%; object-fit: cover; }

.cat-item.active .cat-icon {
border-color: var(--primary-color);
transform: translateY(-5px) scale(1.05);
box-shadow: 0 10px 20px -5px var(--primary-light);
}

.cat-name {
font-size: 0.85rem; font-weight: 500;
color: var(--text-secondary); text-align: center;
line-height: 1.2;
}

.cat-item.active .cat-name { color: var(--primary-color); font-weight: 700; }

/* Product Grid */
.products-section { padding: 10px 0 30px; }
.section-title {
font-size: 1.4rem; font-weight: 800; margin-bottom: 25px;
padding-left: 15px; position: relative;
color: var(--text-main);
}
.section-title::before {
content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
width: 5px; height: 25px; background: var(--primary-color); border-radius: 4px;
}

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }

@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
background: var(--bg-surface);
border-radius: 20px;
padding: 12px;
box-shadow: var(--shadow-soft);
border: 1px solid var(--border-color);
transition: all 0.3s;
height: 100%;
/* Flex container to ensure info stretches */
display: flex;
flex-direction: column;
text-decoration: none; color: inherit;
cursor: pointer;
}

.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.product-img {
border-radius: 15px; overflow: hidden; margin-bottom: 15px;
width: 100%;
aspect-ratio: 1 / 1; /* Modern standard */
position: relative;
background: var(--bg-body);
}
@supports not (aspect-ratio: 1 / 1) {
.product-img { padding-bottom: 100%; height: 0; }
}
.product-img img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
pointer-events: none;
}

.product-info { flex-grow: 1; display: flex; flex-direction: column; }

.product-title {
font-size: 1.05rem; font-weight: 700; margin-bottom: 5px;
color: var(--text-main); line-height: 1.3em;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
height: 2.6em; /* Exactly 2 lines */
min-height: 2.6em; /* Force space even if 1 line */
}

.product-desc {
font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px;
opacity: 0.8;
line-height: 1.3em;
height: 2.6em; /* Exactly 2 lines */
min-height: 2.6em; /* Force space */
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
overflow: hidden;
}

.product-footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: auto; /* Push to bottom */
padding-top: 10px;
}

.product-price {
font-size: 1.1rem;
font-weight: 800;
color: var(--text-main);
}

.add-btn {
width: 32px; height: 32px; border-radius: 8px; /* Slightly smaller for better fit */
background: var(--primary-color); color: white; border: none;
display: flex; align-items: center; justify-content: center; cursor: pointer;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
transition: transform 0.2s;
}
.add-btn:active { transform: scale(0.95); }

/* Detail Modal/Page */
.detail-gallery { position: relative; height: 300px; overflow: hidden; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; }
.detail-content { padding: 20px; background: var(--bg-surface); border-radius: 20px 20px 0 0; margin-top: -20px;
position: relative; z-index: 10; }
.detail-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; }
.detail-desc { color: var(--text-secondary); margin-bottom: 20px; }
.detail-price { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 20px; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Detail Page Redesign */
.detail-body { background: var(--bg-body); }

.detail-nav-overlay {
position: absolute; top: 20px; left: 20px; z-index: 100;
}
.nav-back-btn {
width: 45px; height: 45px; border-radius: 50%;
background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
color: white; display: flex; align-items: center; justify-content: center;
font-size: 1.2rem; transition: transform 0.2s;
}
.nav-back-btn:active { transform: scale(0.9); }

.detail-gallery-wrapper {
height: 50vh; overflow: hidden; position: relative;
}
.detail-gallery, .gallery-item, .gallery-item img {
width: 100%; height: 100%; object-fit: cover;
}
.slick-dots { bottom: 30px; }
.slick-dots li button:before { color: white; font-size: 10px; opacity: 0.5; }
.slick-dots li.slick-active button:before { color: white; opacity: 1; }

.detail-card-container {
padding: 0 20px; margin-top: -40px; position: relative; z-index: 10;
min-height: 50vh;
}
.detail-card {
background: var(--bg-surface);
border-radius: var(--radius-lg);
padding: 30px;
box-shadow: var(--shadow-hover);
border: 1px solid var(--border-color);
}

.detail-header {
display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px;
}
.detail-title { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.detail-category { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px;
margin-top: 5px; display: block; }

.detail-price-badge {
background: var(--primary-light); color: var(--primary-color);
padding: 10px 15px; border-radius: var(--radius-md);
font-size: 1.3rem; font-weight: 700; white-space: nowrap;
}

.detail-divider { height: 1px; background: var(--border-color); margin: 20px 0; }
.detail-description { color: var(--text-secondary); font-size: 1rem; line-height: 1.7; }
/* Modal Styles */
.modal-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.8); z-index: 2000;
display: flex; align-items: center; justify-content: center;
backdrop-filter: blur(5px);
}
.modal-container {
background: var(--bg-surface);
width: 90%; max-width: 500px;
border-radius: var(--radius-lg);
overflow: hidden;
position: relative;
max-height: 90vh;
display: flex; flex-direction: column;
box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
border: 1px solid var(--border-color);
}
.modal-close {
position: absolute; top: 15px; right: 15px; z-index: 10;
width: 35px; height: 35px; border-radius: 50%;
background: rgba(0,0,0,0.6); color: white; border: none;
font-size: 1.2rem; cursor: pointer;
display: flex; align-items: center; justify-content: center;
}
.modal-content-body {
padding: 20px;
overflow-y: auto;
}
.modal-gallery-slider .modal-slide {
height: 300px; background: #000;
}
.modal-gallery-slider img {
width: 100%; height: 100%; object-fit: cover;
}
/* Ensure Dots are visible on white modal */
.modal-gallery-slider .slick-dots { bottom: 15px; }

.modal-product-title {
font-size: 1.5rem; font-weight: 700; color: var(--text-main); line-height: 1.2;
}
.modal-product-cat {
font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase;
}
.modal-product-price {
font-size: 1.4rem; font-weight: 700; color: var(--primary-color);
}
.modal-divider {
height: 1px; background: var(--border-color); margin: 15px 0;
}
.modal-product-desc {
color: var(--text-main); opacity: 0.8; font-size: 0.95rem; line-height: 1.6;
}

/* Fix Text Contrast Issues globally */
h1, h2, h3, h4, h5, h6 { color: var(--text-main) !important; }
p, span, div { color: inherit; } /* inherit from body which has var(--text-main) */

/* Search Overlay */
.search-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
z-index: 2000;
display: flex; flex-direction: column; align-items: center; justify-content: center;
opacity: 0; visibility: hidden;
transition: all 0.3s ease;
}

[data-theme="dark"] .search-overlay {
background: rgba(17, 24, 39, 0.95);
}

.search-overlay.active {
opacity: 1; visibility: visible;
}

.close-search {
position: absolute; top: 30px; right: 30px;
background: none; border: none; font-size: 2.5rem; color: var(--text-muted);
cursor: pointer; transition: color 0.3s;
}
.close-search:hover { color: var(--primary-color); }

.search-container {
width: 90%; max-width: 600px;
text-align: center;
transform: translateY(20px);
transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-overlay.active .search-container {
transform: translateY(0);
}

.search-form {
position: relative;
border-bottom: 2px solid var(--border-color);
display: flex; align-items: center;
}

.search-form input {
width: 100%;
background: none; border: none; outline: none;
font-size: 2rem; font-weight: 600;
color: var(--text-main);
padding: 15px 50px 15px 0;
}

.search-form input::placeholder { color: var(--text-muted); opacity: 0.5; }

.search-submit {
position: absolute; right: 0;
background: none; border: none;
font-size: 2rem; color: var(--primary-color);
cursor: pointer;
}

.search-suggestions {
margin-top: 20px;
color: var(--text-secondary);
}

/* Logo Switching Logic */
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

/* Keep logo-dark hidden by default (done inline but reinforced here for specificity) */
body:not([data-theme="dark"]) .logo-dark { display: none !important; }