/**
 * Vişne Shop — global tasarım sistemi
 * Tüm sayfalar theme_helper :root değişkenlerini kullanır.
 */

:root {
    --vs-radius-sm: 8px;
    --vs-radius: 12px;
    --vs-radius-lg: 18px;
    --vs-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --vs-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    --vs-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --vs-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --vs-container: 1180px;
    --vs-gap: 1.25rem;
    --vs-transition: 0.22s ease;
}

/* Fallback tokens (theme yüklenmeden önce) */
:root {
    --vs-primary: #8b3a8b;
    --vs-secondary: #c44569;
    --vs-accent: #ff6b9d;
    --vs-button: #8b3a8b;
    --vs-bg: #faf9fb;
    --vs-text: #2d2a32;
    --vs-surface: #ffffff;
    --vs-surface-muted: #f4f2f6;
    --vs-border: #e8e4ed;
    --vs-muted: #6b6574;
    --vs-header-gradient: linear-gradient(128deg, var(--vs-accent) 0%, var(--vs-secondary) 48%, var(--vs-primary) 100%);
}

html {
    scroll-behavior: smooth;
}

body.vs-storefront {
    font-family: var(--vs-font);
    background: var(--vs-bg);
    color: var(--vs-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sayfa iskeleti ---- */
.vs-page,
.category-page,
.cart-page,
.checkout-page,
.account-page,
.auth-page,
.content-page,
.product-detail-page,
.search-page {
    max-width: var(--vs-container);
    margin: 0 auto;
    padding: 2rem 1.15rem 3rem;
}

.vs-page-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.15rem 3rem;
}

/* ---- Başlıklar ---- */
.section-title,
.category-title,
.page-title,
.content-hero h1,
.cart-title,
.checkout-title {
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--vs-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.section-title {
    text-align: center;
    text-transform: none;
    letter-spacing: -0.03em;
}

.category-title {
    text-align: left;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid color-mix(in srgb, var(--vs-primary) 18%, transparent);
}

.page-subtitle,
.content-lead {
    color: var(--vs-muted);
    font-size: 1.02rem;
    max-width: 62ch;
}

/* ---- Kartlar & yüzeyler ---- */
.vs-card,
.product-card,
.filters-section,
.cart-item,
.summary-box,
.auth-box,
.content-card,
.info-box,
.checkout-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius);
    box-shadow: var(--vs-shadow-sm);
    transition: transform var(--vs-transition), box-shadow var(--vs-transition), border-color var(--vs-transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--vs-shadow);
    border-color: color-mix(in srgb, var(--vs-primary) 22%, var(--vs-border));
}

.filters-section,
.summary-box,
.auth-box {
    padding: 1.25rem 1.35rem;
}

/* ---- Ürün grid ---- */
.products-container,
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--vs-gap);
}

.product-image {
    background: var(--vs-surface-muted) !important;
    border-bottom: 1px solid var(--vs-border);
}

.product-info {
    padding: 1rem 1.1rem 1.15rem;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--vs-text);
    line-height: 1.35;
    margin-bottom: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Fiyatlar (inline override'ları ezer) ---- */
.price-old + .price-current,
.old-price + .current-price,
.sale-price,
.discount-price,
.price-new,
.product-price .price-current:has(+ .price-old),
.product-price:has(.price-old) .price-current {
    color: var(--vs-primary) !important;
}

.price-current,
.current-price,
.normal-price,
.product-price {
    color: var(--vs-muted) !important;
}

/* ---- Butonlar ---- */
.vs-btn,
.btn-primary,
.checkout-btn,
.continue-btn,
.add-to-cart-btn,
.search-btn,
.submit-btn,
.auth-submit,
.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 1.25rem;
    border-radius: var(--vs-radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--vs-transition), transform var(--vs-transition), box-shadow var(--vs-transition);
}

.btn-primary,
.checkout-btn,
.add-to-cart-btn,
.search-btn,
.submit-btn,
.auth-submit {
    background: var(--vs-button) !important;
    color: #fff !important;
    border-color: var(--vs-button) !important;
}

.btn-primary:hover,
.checkout-btn:hover,
.add-to-cart-btn:hover,
.search-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.continue-btn,
.vs-btn-outline {
    background: var(--vs-surface);
    color: var(--vs-primary);
    border: 1px solid color-mix(in srgb, var(--vs-primary) 35%, var(--vs-border));
}

/* ---- Formlar ---- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea,
.filter-select,
.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-sm);
    background: var(--vs-surface);
    color: var(--vs-text);
    font-size: 0.95rem;
    transition: border-color var(--vs-transition), box-shadow var(--vs-transition);
}

input:focus,
select:focus,
textarea:focus,
.filter-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--vs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--vs-primary) 14%, transparent);
}

.filter-label,
.form-label {
    font-weight: 600;
    color: var(--vs-text);
    font-size: 0.86rem;
    margin-bottom: 0.35rem;
}

/* ---- Banner & hero ---- */
.banner-section {
    background: var(--vs-header-gradient) !important;
}

.best-sellers-section,
.feature-section {
    background: var(--vs-surface-muted) !important;
}

.content-hero,
.page-hero {
    background: var(--vs-header-gradient);
    color: #fff;
    padding: 2.5rem 1.5rem;
    border-radius: var(--vs-radius-lg);
    margin-bottom: 2rem;
}

.content-hero h1,
.page-hero h1 {
    color: #fff;
    margin-bottom: 0.5rem;
}

/* ---- Kategori landing ---- */
.landing-page,
.category-landing {
    padding: 2rem 1.15rem 3rem;
    max-width: var(--vs-container);
    margin: 0 auto;
}

.landing-grid,
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.landing-card,
.subcategory-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius);
    padding: 1.1rem;
    text-align: center;
    text-decoration: none;
    color: var(--vs-text);
    transition: border-color var(--vs-transition), transform var(--vs-transition);
}

.landing-card:hover,
.subcategory-card:hover {
    border-color: var(--vs-primary);
    transform: translateY(-2px);
    color: var(--vs-primary);
}

/* ---- Sepet & ödeme ---- */
.cart-page,
.checkout-page {
    display: grid;
    gap: 1.5rem;
}

.cart-summary,
.order-summary {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius);
    padding: 1.35rem;
    position: sticky;
    top: 6rem;
}

.coupon-box {
    border: 1px dashed color-mix(in srgb, var(--vs-primary) 40%, var(--vs-border));
    background: color-mix(in srgb, var(--vs-primary) 5%, var(--vs-surface));
    border-radius: var(--vs-radius-sm);
    padding: 1rem;
}

/* ---- Auth ---- */
.auth-page {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.75rem;
}

.auth-box h1 {
    color: var(--vs-primary);
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.register-link a,
.forgot-link a {
    color: var(--vs-primary);
    font-weight: 600;
}

/* ---- İçerik sayfaları ---- */
.content-page section {
    margin-bottom: 2rem;
}

.content-page h2 {
    color: var(--vs-primary);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
}

.content-page ul,
.content-page ol {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
}

.content-page li {
    margin-bottom: 0.4rem;
}

.info-box {
    padding: 1rem 1.15rem;
    border-left: 4px solid var(--vs-accent);
    background: color-mix(in srgb, var(--vs-accent) 8%, var(--vs-surface));
}

/* ---- Footer ---- */
.site-footer {
    background: linear-gradient(165deg,
        color-mix(in srgb, var(--vs-text) 92%, #000) 0%,
        color-mix(in srgb, var(--vs-text) 98%, #000) 100%) !important;
    color: #e8e4ed;
    padding: 3.5rem 1.25rem 1.75rem;
    margin-top: 4rem;
    border-top: 3px solid color-mix(in srgb, var(--vs-accent) 55%, transparent);
}

.footer-section h3,
.footer-address-box h4 {
    color: var(--vs-accent) !important;
}

.footer-links a:hover,
.footer-bottom a {
    color: var(--vs-accent) !important;
}

.footer-address-box {
    border-color: color-mix(in srgb, var(--vs-accent) 35%, transparent) !important;
}

/* ---- WhatsApp widget ---- */
.wa-edge-tab {
    background: var(--vs-button) !important;
}

.wa-panel-header {
    background: var(--vs-header-gradient) !important;
}

/* ---- Yardımcılar ---- */
.vs-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--vs-primary) 12%, var(--vs-surface));
    color: var(--vs-primary);
}

.vs-divider {
    height: 1px;
    background: var(--vs-border);
    margin: 1.5rem 0;
}

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

/* ---- Masaüstü iyileştirmeler ---- */
@media (min-width: 1024px) {
    .products-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .cart-page.has-sidebar {
        grid-template-columns: 1fr 340px;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .products-container,
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
