/*
Theme Name: QualityTop
Theme URI: https://shopexpert.store
Author: Amatech
Description: Clean, conversion-focused Amazon affiliate theme - uk.market.com style
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: qualitytop
*/

/* ===== CSS Variables - uk.market.com colors ===== */
:root {
    /* Primary colors */
    --color-primary: #161616;
    --color-secondary: #343942;
    --color-accent: #f0ad00;
    --color-accent-hover: #d49900;

    /* Text colors */
    --color-text: #0f1111;
    --color-text-light: #565959;
    --color-text-muted: #7b848d;

    /* Background colors */
    --color-bg: #ffffff;
    --color-bg-alt: #f7f7f7;
    --color-bg-hero: linear-gradient(135deg, #b8e6e3 0%, #d4ede8 50%, #e8f4f2 100%);

    /* Functional colors */
    --color-success: #388501;
    --color-danger: #cc0c39;
    --color-border: #ddd;
    --color-border-light: #eee;

    /* Typography */
    --font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Container */
    --container-max: 1200px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}
a { color: var(--color-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}
.text-center { text-align: center; }
.mt-3 { margin-top: 2rem; }

/* ===== Header - uk.market.com style (dark) ===== */
/* Logo+search is sticky, nav scrolls away */
.header-main {
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #3d4450;
}
.header-main-content {
    display: flex;
    align-items: center;
    gap: 25px;
}
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}
.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
}
.site-logo {
    text-decoration: none;
    flex-shrink: 0;
}
.logo-text {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    text-transform: lowercase;
}
.logo-accent {
    color: var(--color-accent);
}

/* Search Bar - uk.market.com style (white bg, rounded) */
.main-search-holder {
    flex: 1;
}
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon-inside {
    position: absolute;
    left: 15px;
    color: #888;
    z-index: 1;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    background: #fff;
    color: #333;
}
.search-input::placeholder {
    color: #999;
}
.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-accent);
}

/* Main Navigation - uk.market.com style */
.main-navigation {
    background: #3d4450;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow-x: auto;
}
.primary-menu li a {
    display: block;
    padding: 12px 15px;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
}
.primary-menu li a:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}
/* Products Database link - right side */
.nav-db-link {
    color: #fff;
    font-size: 14px;
    padding: 12px 15px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
.nav-db-link:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}


/* ===== Hero Section - uk.market.com style ===== */
.hero-section {
    background: var(--color-bg-hero);
    position: relative;
}
.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
}
.hero-disclosure {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.hero-disclosure .info-icon {
    font-style: normal;
    margin-right: 4px;
}
.hero-content {
    flex: 0 0 45%;
    max-width: 550px;
}
.hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-primary);
    margin: 0 0 25px 0;
}
.hero-subtitle {
    font-size: 16px;
    color: var(--color-text-light);
    line-height: 1.7;
    margin: 0;
}
.hero-image {
    flex: 0 0 50%;
    text-align: right;
}
.hero-image img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

/* ===== Section Titles ===== */
.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 25px 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.section-header .section-title {
    margin: 0;
}

/* ===== Popular Products (Categories Grid) ===== */
.popular-products {
    padding: 50px 0;
    background: var(--color-bg);
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 15px 0 15px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    overflow: hidden;
}
.category-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-decoration: none;
}
.category-image {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.category-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.placeholder-icon {
    font-size: 48px;
}
.category-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    background: #f5f5f5;
    width: calc(100% + 30px);
    margin-left: -15px;
    margin-right: -15px;
    padding: 15px;
    margin-top: auto;
    border-radius: 0 0 12px 12px;
}

/* ===== Latest Products (Deals Grid) - uk.market.com style ===== */
.latest-products {
    padding: 50px 0;
    background: var(--color-bg-alt);
}
.deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Deal Card - Exact uk.market.com style */
.deal-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.deal-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Deal Image */
.deal-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--color-bg);
}
.deal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Discount Row */
.discount-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.deal-badge {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}
.amazon-badge {
    display: flex;
    align-items: center;
}
.amazon-logo-svg {
    height: 12px;
    width: auto;
}

/* Deal Pricing - uk.market.com style */
.deal-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}
.current-price {
    display: flex;
    align-items: flex-start;
    color: var(--color-text);
    font-weight: 400;
}
.current-price .currency {
    font-size: 14px;
    margin-right: 2px;
    margin-top: 2px;
}
.current-price .price-int {
    font-size: 28px;
    line-height: 1;
}
.current-price .price-dec {
    font-size: 14px;
    margin-top: 2px;
}
.old-price {
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* Deal Title */
.deal-title {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-text);
    margin: 0 0 15px 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Deal Actions */
.deal-actions {
    margin-top: auto;
}
.deal-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-accent);
    color: var(--color-primary);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.deal-read-more:hover {
    background: var(--color-accent-hover);
    text-decoration: none;
}
.deal-read-more .chevron {
    font-size: 18px;
}

/* See All Button */
.btn-see-all {
    display: inline-block;
    background: transparent;
    color: var(--color-text);
    padding: 12px 30px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-see-all:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

/* ===== Footer - uk.market.com style ===== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: 50px;
}
.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    padding: 50px 0;
}
.footer-brand .logo-text {
    font-size: 24px;
    margin-bottom: 15px;
    display: block;
    text-transform: lowercase;
}
.footer-brand p {
    color: var(--color-text-light);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}
.footer-col h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 20px 0;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: var(--color-text-light);
    font-size: 14px;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--color-accent);
}
.footer-bottom {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
}
.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 12px;
    margin: 5px 0;
    line-height: 1.5;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 1024px) {
    .categories-grid,
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header-main-content {
        flex-direction: column;
        gap: 15px;
    }
    .main-navigation {
        display: none;
    }
    .menu-toggle {
        display: flex;
    }
    .header-main-content {
        flex-direction: row;
        align-items: center;
    }
    .main-search-holder {
        max-width: 100%;
        width: 100%;
    }
    .nav-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    .primary-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .nav-db-link {
        padding: 12px 15px;
        border-top: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }
    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-title {
        font-size: 32px;
    }
    .hero-image {
        text-align: center;
    }
    .categories-grid,
    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .deals-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 26px;
    }
}

/* ===== Product Badges - Market.com style ===== */
.number-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: stretch;
    border-radius: 6px 0 0 0;
    overflow: visible;
}

.number-wrapper .number {
    background: #005f5f;
    color: #fff;
    padding: 10px 20px 10px 14px;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 6px 0 0 0;
}

.number-wrapper .number::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 0;
    bottom: 0;
    width: 30px;
    background: #005f5f;
    transform: skewX(-15deg);
    z-index: 1;
}

.number-wrapper .number span {
    font-size: 20px;
    position: relative;
    z-index: 2;
}

.number-wrapper .product-badge {
    background: #008080;
    color: #fff;
    padding: 10px 18px 10px 24px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    margin-left: 8px;
    position: relative;
    z-index: 0;
}
