/**
 * SuperMarket E-Commerce
 * Main Stylesheet
 * 
 * Brand Colors:
 * Primary: #0B1B5A (Brand Blue)
 * Secondary: #C62828 (Brand Red)
 * Accent: #F4F7FF (Accent/Light)
 * Text Dark: #1F2933
 * Background: #FFFFFF
 * Border: #E5E7EB
 */

/* ===== CSS Variables ===== */
:root {
    --brand-primary: #0B1B5A;
    --brand-secondary: #C62828;
    --brand-accent: #F4F7FF;
    --brand-text-dark: #1F2933;
    --brand-bg-white: #FFFFFF;
    --brand-border: #E5E7EB;
    
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Playfair Display', serif;
    
    --transition: all 0.3s ease;
    --box-shadow: 0 2px 8px rgba(11, 27, 90, 0.08);
    --box-shadow-hover: 0 8px 24px rgba(11, 27, 90, 0.12);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--brand-text-dark);
    background-color: var(--brand-bg-white);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: var(--brand-primary);
    transition: var(--transition);
}

a:hover {
    color: var(--brand-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Top Bar ===== */
.top-bar {
    background-color: var(--brand-primary);
    color: var(--brand-bg-white);
    padding: 10px 0;
    font-size: 14px;
}

.top-bar a {
    color: var(--brand-bg-white);
    transition: var(--transition);
}

.top-bar a:hover {
    color: var(--brand-accent);
    transform: translateY(-1px);
}

.top-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.top-bar-right .top-link {
    margin-left: 20px;
}

/* ===== Main Navigation ===== */
.main-navbar {
    background-color: var(--brand-bg-white);
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    transition: var(--transition);
}

.main-navbar.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-primary);
}

.logo-img {
    height: 45px;
    width: auto;
}

.logo-text {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--brand-text-dark);
    font-weight: 500;
    padding: 8px 15px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--brand-secondary);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-secondary);
}

.nav-link:hover::after {
    width: 60%;
}

.dropdown-menu {
    border: 1px solid var(--brand-border);
    box-shadow: var(--box-shadow);
    border-radius: 8px;
    padding: 10px 0;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px 20px;
    color: var(--brand-text-dark);
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
    padding-left: 25px;
}

/* ===== Search Form ===== */
.search-form {
    width: 300px;
}

.search-form .input-group {
    border: 2px solid var(--brand-border);
    border-radius: 25px;
    overflow: hidden;
    transition: var(--transition);
}

.search-form .input-group:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(11, 27, 90, 0.1);
}

.search-form .form-control {
    border: none;
    padding: 10px 20px;
}

.search-form .form-control:focus {
    box-shadow: none;
}

.btn-search {
    background-color: var(--brand-primary);
    color: var(--brand-bg-white);
    border: none;
    padding: 10px 20px;
    transition: var(--transition);
}

.btn-search:hover {
    background-color: var(--brand-secondary);
    color: var(--brand-bg-white);
}

/* ===== Call to Order Button ===== */
.btn-call-order {
    background: linear-gradient(135deg, var(--brand-secondary), #d32f2f);
    color: var(--brand-bg-white);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-call-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
    color: var(--brand-bg-white);
}

.btn-call-order i {
    animation: ring 2s infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--brand-primary), #0f2573);
    color: var(--brand-bg-white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    color: var(--brand-bg-white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-image {
    position: relative;
    z-index: 1;
}

.hero-image img {
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== Section Titles ===== */
.section-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-secondary), transparent);
    border-radius: 2px;
}

.section-subtitle {
    color: #6B7280;
    font-size: 18px;
    margin-bottom: 40px;
}

/* ===== Product Card ===== */
.product-card {
    background: var(--brand-bg-white);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-5px);
    border-color: var(--brand-primary);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background-color: var(--brand-accent);
    padding-top: 100%; /* 1:1 Aspect Ratio */
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--brand-secondary);
    color: var(--brand-bg-white);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

.product-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-section {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--brand-border);
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary);
}

.product-price-original {
    font-size: 18px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.btn-call-product {
    background: var(--brand-secondary);
    color: var(--brand-bg-white);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-call-product:hover {
    background: #a62020;
    color: var(--brand-bg-white);
    transform: translateY(-2px);
}

/* ===== Category Card ===== */
.category-card {
    background: var(--brand-bg-white);
    border: 2px solid var(--brand-border);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
}

.category-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-5px);
}

.category-icon {
    font-size: 48px;
    color: var(--brand-primary);
    margin-bottom: 15px;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    color: var(--brand-secondary);
    transform: scale(1.1);
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-text-dark);
    margin-bottom: 0;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background-color: var(--brand-accent);
    padding: 15px 0;
    margin-bottom: 30px;
    border-radius: 8px;
}

.breadcrumb-item a {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--brand-text-dark);
}

/* ===== Pagination ===== */
.pagination {
    margin-top: 40px;
}

.page-link {
    color: var(--brand-primary);
    border: 1px solid var(--brand-border);
    padding: 10px 15px;
    margin: 0 3px;
    border-radius: 8px;
}

.page-link:hover {
    background-color: var(--brand-primary);
    color: var(--brand-bg-white);
    border-color: var(--brand-primary);
}

.page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ===== Newsletter Section ===== */
.newsletter-section {
    background: linear-gradient(135deg, var(--brand-primary), #0f2573);
    padding: 60px 0;
    margin-top: 60px;
}

.newsletter-title {
    color: var(--brand-bg-white);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.newsletter-text {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 30px;
}

.newsletter-form .input-group {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form .form-control {
    padding: 15px 20px;
    border: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.btn-newsletter {
    background: var(--brand-secondary);
    color: var(--brand-bg-white);
    border: none;
    padding: 15px 30px;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    transition: var(--transition);
}

.btn-newsletter:hover {
    background: #a62020;
    color: var(--brand-bg-white);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--brand-text-dark);
    color: #D1D5DB;
    padding: 60px 0 30px;
}

.footer-heading {
    color: var(--brand-bg-white);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-text {
    line-height: 1.8;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--brand-bg-white);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--brand-secondary);
    color: var(--brand-bg-white);
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #D1D5DB;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--brand-bg-white);
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    color: #D1D5DB;
}

.footer-contact i {
    color: var(--brand-secondary);
    margin-top: 3px;
}

.footer-contact a {
    color: #D1D5DB;
}

.footer-contact a:hover {
    color: var(--brand-bg-white);
}

.footer-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 30px 0;
}

.footer-copyright {
    color: #9CA3AF;
    margin: 0;
}

.footer-legal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.footer-legal a {
    color: #9CA3AF;
}

.footer-legal a:hover {
    color: var(--brand-bg-white);
}

/* ===== WhatsApp Floating Button ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: var(--brand-bg-white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
}

.whatsapp-float:hover {
    background: #20BA5A;
    color: var(--brand-bg-white);
    transform: scale(1.1);
}

/* ===== Skeleton Loader ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 400px;
}

.skeleton-image {
    height: 250px;
    width: 100%;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-text-short {
    height: 20px;
    width: 60%;
}

/* ===== Utility Classes ===== */
.section-spacing {
    padding: 60px 0;
}

.bg-light-accent {
    background-color: var(--brand-accent);
}

.text-primary-brand {
    color: var(--brand-primary);
}

.text-secondary-brand {
    color: var(--brand-secondary);
}

/* ===== Lazy Load Image Fade ===== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-image.loaded {
    opacity: 1;
}
