:root {
    --primary-color: #1976d2;
    /* Blue */
    --primary-light: #63a4ff;
    --secondary-color: #03dac6;
    /* Teal */
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --text-primary: #000000;
    --text-secondary: #666666;
    --error-color: #b00020;
    --border-radius: 8px;
    /* Slightly sharper corners like reference */
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #2196f3;
    --primary-light: #64b5f6;
    --secondary-color: #03dac6;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent !important;
}

/* Explicitly set tap highlight and remove outlines for interactive elements */
a,
button,
input,
select,
textarea,
.btn,
.card,
.nav-item,
div,
span,
img {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    -webkit-touch-callout: none !important;
    /* Disable long-press callout */
}

/* Prevent text selection on interactive elements to avoid highlight box */
a,
button,
.btn,
.nav-item,
.card {
    user-select: none;
    -webkit-user-select: none;
}

*:focus,
*:active,
*:hover,
*:focus-visible {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: none !important;
    /* Force remove any focus shadow */
}

/* Restore box-shadow for specific hover states if needed, but keep focus clean */
.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    padding-bottom: 60px;
    /* Space for bottom nav on mobile */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1400px;
    /* Wider container for more products */
    margin: 0 auto;
    padding: 0 16px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5em;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    /* Sharper buttons */
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: black;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Header / AppBar */
.app-bar {
    background-color: rgba(15, 23, 42, 0.95);
    /* Deep dark blue/slate */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.app-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desktop-nav {
    display: none;
    margin-left: auto;
}

.desktop-nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.desktop-nav a {
    font-weight: 500;
    color: #cbd5e1;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.language-selector {
    margin-left: 20px;
    margin-right: 0;
}

.language-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--surface-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1001;
    min-width: 150px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.language-menu div {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.language-menu div:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

[data-theme="dark"] .language-menu {
    background-color: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .language-menu div {
    color: #e2e8f0;
}

[data-theme="dark"] .language-menu div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 10px rgba(96, 165, 250, 0.3);
}

.logo i {}

.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.desktop-nav a:hover {
    color: #ffffff;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after {
    width: 100%;
}

.desktop-nav a.active {
    color: #ffffff;
    font-weight: 600;
}

/* Mobile Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--box-shadow);
    margin-bottom: 16px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Product Card Specifics */
.product-card {
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.1);
}

.badge-sale {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #448aff;
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.current-price {
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.1rem;
}

.original-price {
    color: #999;
    font-size: 0.9rem;
    text-decoration: line-through;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background-color: #2962ff;
    color: white;
    font-weight: 600;
    border-radius: 4px;
    padding: 10px;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #0039cb;
}

/* Grid System */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background-color: var(--background-color);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .bottom-nav {
        display: none;
    }

    .desktop-nav {
        display: block;
    }

    .grid-md-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-md-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-md-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .grid-lg-6 {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Carousel Styles */
.carousel-container {
    max-width: 100%;
    position: relative;
    margin: auto;
    overflow: hidden;
    margin-bottom: 30px;
}

.carousel-slide {
    display: none;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 500px;
    /* Fixed height for desktop */
    object-fit: cover;
    object-position: center;
}

/* Navigation Buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Hide arrows on mobile and adjust image height */
@media (max-width: 768px) {

    .prev,
    .next {
        display: none;
    }

    .carousel-slide img {
        height: 150px;
        /* Increased height for mobile */
        object-fit: cover;
    }
}

/* Dots */
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 2px;
    background-color: #ffffff;
    /* White for better visibility on dark images */
    opacity: 0.6;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease, opacity 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: var(--primary-color);
    opacity: 1;
}

/* Fade Animation */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

/* Mobile Header Adjustments */
@media (max-width: 768px) {
    .app-bar {
        padding: 15px 0;
    }

    .app-bar .container {
        padding: 0 12px;
    }

    .logo {
        font-size: 1.2rem;
        gap: 6px;
    }

    .logo i {
        font-size: 1.1rem;
    }

    .language-selector {
        margin-right: 0;
    }

    .language-selector img {
        height: 24px !important;
        width: auto;
    }
}

/* Desktop Footer Styles */
.desktop-footer {
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 60px 0 20px;
    margin-top: auto;
    display: none;
    /* Hidden by default (mobile) */
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #cbd5e1;
    transition: color 0.3s;
    text-decoration: none;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive Footer Visibility */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }

    .desktop-footer {
        display: block;
    }

    body {
        padding-bottom: 0;
        /* Reset padding on desktop */
    }

    /* Adjust floating buttons for desktop footer */
    .floating-buttons {
        bottom: 40px;
    }
}