/* OverSpeed App UI - overrides & additions for reference image style */

:root {
    --primary: #FFC107;
    --primary-dark: #e6ac00;
    --black: #111111;
    --dark: #1a1a1a;
    --gray: #f8f8f8;
    --gray-2: #eeeeee;
    --text: #333333;
    --text-light: #777777;
    --white: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --app-max: 600px;
}

body {
    background: var(--gray);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.container {
    max-width: var(--app-max);
    padding: 0 14px;
}

/* App-style header */
.app-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-2);
}
.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    gap: 12px;
    max-width: var(--app-max);
    margin: 0 auto;
    padding: 0 14px;
}
.app-header .menu-btn,
.app-header .cart-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.app-header .cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: var(--black);
    font-size: 0.65rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-header .logo-center img {
    height: 80px;
}
.app-header .logo-center .logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--black);
}
.app-header .logo-center .logo-text span { color: var(--primary); }

/* Side drawer */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
}
.drawer-overlay.open { display: block; }
.side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--white);
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.side-drawer.open { transform: translateX(0); }
.drawer-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--gray-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header .close-btn {
    border: none;
    background: none;
    font-size: 1.4rem;
    cursor: pointer;
}
.drawer-nav {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}
.drawer-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-weight: 600;
    border-bottom: 1px solid var(--gray-2);
}
.drawer-nav li a:hover,
.drawer-nav li a.active {
    background: var(--gray);
    color: var(--black);
}
.drawer-footer {
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Hero banner - full-width horizontal image from admin */
.hero-banner {
    margin: 0 -14px 14px;
    background: var(--dark);
    position: relative;
}
.hero-slider {
    position: relative;
    overflow: hidden;
}
.hero-slide {
    display: none;
    width: 100%;
}
.hero-slide.active { display: block; }
.hero-slide img {
    width: 100%;
    height: auto;
    display: block;
}
.hero-mobile { display: none; }
.hero-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 40px;
}
.hero-empty img {
    max-height: 120px;
    opacity: 0.4;
}
.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    background: var(--white);
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-2);
    border: none;
    cursor: pointer;
}
.hero-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }
.hero-mobile-dots { display: none; }

@media (min-width: 901px) {
    .hero-banner { margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; }
    .hero-desktop { display: block; }
    .hero-mobile { display: none; }
    .hero-desktop-dots { display: flex; }
    .hero-mobile-dots { display: none; }
}

@media (max-width: 900px) {
    .hero-desktop { display: none; }
    .hero-mobile { display: block; }
    .hero-desktop-dots { display: none; }
    .hero-mobile-dots { display: flex; }
}

/* Category icons */
.category-icons-section {
    padding: 8px 0 16px;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-head h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--black);
    margin: 0;
}
.section-head a {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}
.category-icons {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 12px;
    justify-content: flex-start;
}
.category-icons::-webkit-scrollbar { display: none; }
.category-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 100px;
    padding: 8px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-decoration: none;
    scroll-snap-align: start;
    flex-shrink: 0;
}
.category-icon-item:hover {
    background: rgba(255,193,7,0.12);
    transform: translateY(-3px);
}
.category-icon-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 4px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.category-icon-item:hover img {
    transform: scale(1.08);
}
.category-icon-item span {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .category-icons { gap: 12px; }
    .category-icon-item { min-width: 80px; }
    .category-icon-item img { width: 64px; height: 64px; }
    .category-icon-item span { font-size: 0.75rem; }
}

@media (max-width: 600px) {
    .category-icons { gap: 10px; }
    .category-icon-item { min-width: 72px; }
    .category-icon-item img { width: 56px; height: 56px; }
    .category-icon-item span { font-size: 0.7rem; }
}

/* Product card app style */
.product-grid.app {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.product-card.app {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.product-card.app .product-image-wrap {
    aspect-ratio: 1 / 1.1;
    background: var(--gray);
    position: relative;
}
.product-card.app .product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card.app .cart-btn-card {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}
.product-card.app .product-info {
    padding: 10px;
}
.product-card.app .product-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--black);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}
.product-card.app .product-rating {
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.product-card.app .product-rating .count {
    color: var(--text-light);
    font-size: 0.7rem;
}
.product-card.app .product-views {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 6px;
}
.product-card.app .product-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.product-card.app .price-current {
    font-size: 1rem;
    font-weight: 800;
    color: var(--black);
}
.product-card.app .price-old {
    font-size: 0.75rem;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Shop page */
.shop-header {
    background: var(--white);
    padding: 12px 0;
    position: sticky;
    top: 58px;
    z-index: 90;
    border-bottom: 1px solid var(--gray-2);
}
.shop-search {
    position: relative;
    margin-bottom: 10px;
}
.shop-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--gray-2);
    border-radius: 24px;
    background: var(--gray);
    font-size: 0.9rem;
    outline: none;
}
.shop-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
}
.shop-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.shop-filter-row::-webkit-scrollbar { display: none; }
.filter-chip,
.sort-chip {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-2);
    background: var(--white);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.filter-chip.active,
.sort-chip.active,
.filter-chip:hover,
.sort-chip:hover {
    background: var(--black);
    color: var(--primary);
    border-color: var(--black);
}
.filter-select {
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid var(--gray-2);
    background: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

/* Contact page app style */
.about-hero {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 14px 0;
}
.about-hero img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.about-hero-content {
    padding: 16px;
}
.about-hero-content h1 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 8px;
}
.about-hero-content p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.feature-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.feature-item .icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}
.feature-item .label {
    font-size: 0.7rem;
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}

.brand-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.brand-item {
    aspect-ratio: 3 / 2;
    background: var(--gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    border: 1px solid var(--gray-2);
}
.brand-item img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.contact-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.contact-card h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 14px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-2);
}
.contact-item:last-child { border-bottom: none; }
.contact-item .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.contact-item .text {
    flex: 1;
}
.contact-item .text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--black);
    margin-bottom: 2px;
}
.contact-item .text span,
.contact-item .text a {
    font-size: 0.8rem;
    color: var(--text-light);
    word-break: break-all;
}
.contact-item .text a:hover { color: var(--primary-dark); }

.map-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.map-card iframe {
    width: 100%;
    height: 220px;
    border: 0;
    display: block;
}
.map-empty {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Product detail music theme */
.product-detail {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--white) 0%, #fffdf5 100%);
}
.detail-info {
    position: relative;
    z-index: 1;
}
.detail-music-decor {
    position: absolute;
    top: 0;
    right: -10px;
    font-size: 4.5rem;
    color: var(--primary);
    opacity: 0.15;
    transform: rotate(-12deg);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}
.detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--black);
}
.detail-title .music-icon {
    font-size: 1.5rem;
    animation: musicBounce 1.4s ease-in-out infinite;
    color: var(--primary-dark);
}
@keyframes musicBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}
.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.detail-meta .meta-cat {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}
.detail-meta .meta-rating {
    background: #fffde7;
    color: #f57f17;
    border: 1px solid #fff59d;
}
.detail-meta .meta-view {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.detail-price {
    background: linear-gradient(90deg, #e65100, #f57c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.detail-stock {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    border: 1px solid #a5d6a7;
}
.detail-colors {
    margin: 12px 0;
}
.detail-colors label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-option {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-2);
    background: var(--white);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.color-option:hover,
.color-option.active {
    background: var(--black);
    color: var(--primary);
    border-color: var(--black);
}
.detail-desc {
    background: #fafafa;
    border-left: 4px solid var(--primary);
    padding: 14px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #444;
}
.btn-line {
    background: #06C755;
    color: #fff;
}
.btn-line:hover {
    background: #05a347;
}

@media (max-width: 600px) {
    .detail-music-decor { font-size: 3.5rem; top: 5px; right: -5px; }
    .detail-title { font-size: 1.15rem; }
}

/* Promo image */
.promo-image {
    margin: 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.promo-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Related products section */
.related-section {
    margin: 28px 0 16px;
}
.related-section h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1200px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Bottom nav app style - compact floating design */
.app-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 8px 8px;
    pointer-events: none;
}
.app-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    margin: 0 auto;
    padding: 4px 6px;
    max-width: 520px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    pointer-events: auto;
}
.app-nav li { flex: 1; }
.app-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.55rem;
    color: #8898aa;
    font-weight: 700;
    padding: 4px 2px;
    transition: all 0.2s ease;
    border-radius: 14px;
}
.app-nav a .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.app-nav a .nav-icon svg {
    width: 100%;
    height: 100%;
}
.app-nav a .label { white-space: nowrap; }
.app-nav a:hover { color: var(--black); background: rgba(255,193,7,0.1); }
.app-nav a:hover .nav-icon { transform: scale(1.1); }
.app-nav a.active {
    color: var(--primary-dark);
    transform: translateY(-3px);
}
.app-nav a.active .nav-icon {
    background: var(--primary);
    color: var(--black);
    padding: 4px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(255,193,7,0.4);
    transform: translateY(-1px);
}
.app-nav a.nav-line { color: #06C755; }
.app-nav a.nav-line .nav-icon svg { filter: drop-shadow(0 1px 2px rgba(6,199,85,0.2)); }
.app-nav a.nav-line:hover { background: rgba(6,199,85,0.08); }

@media (max-width: 900px) {
    .app-nav { display: block; }
    body { padding-bottom: 66px; }
    .site-header { display: none; }
    .category-bar { display: none; }
    .site-footer { margin-bottom: 0; }
    .mobile-nav { display: none; }
}

@media (max-width: 380px) {
    .app-nav a .nav-icon { width: 20px; height: 20px; }
    .app-nav a .label { font-size: 0.5rem; }
}

@media (min-width: 901px) {
    .app-header { display: none; }
    .app-nav { display: none; }
}

@media (min-width: 1200px) {
    .container { max-width: 1200px; }
    .product-grid.app { grid-template-columns: repeat(4, 1fr); }
    .app-header-inner { max-width: 1200px; }
}

@media (max-width: 600px) {
    .product-grid.app { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-grid.app.mobile-1 { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .brand-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-content h2 { font-size: 1.4rem; }
}
