/* ============================================================
   SHARP & PROFESSIONAL — Design System
   Primary: #003366  |  Accent: #FF6600
   Surface: #FFFFFF  |  BG: #F4F7F9
   Radius: 4px       |  Border: 1px solid #e0e0e0
   ============================================================ */

/* --- Z-INDEX SCALE --- */
:root {
    --sp-primary:     #003366;
    --sp-accent:      #FF6600;
    --sp-surface:     #FFFFFF;
    --sp-bg:          #F4F7F9;
    --sp-border:      #e0e0e0;
    --sp-text:        #1a1a2e;
    --sp-text-muted:  #6b7280;
    --sp-radius:      4px;
    --sp-shadow:      0 2px 8px rgba(0,0,0,0.06);
    --sp-shadow-md:   0 4px 16px rgba(0,0,0,0.10);

    /* Dynamic theme vars — fallback to SP palette */
    --main-color:     var(--sp-accent);
    --secondary-color:#cc5200;
    --bg-color:       var(--sp-bg);
    --text-color:     var(--sp-text);
    --navbar-bg:      var(--sp-primary);
    --footer-bg:      var(--sp-primary);

    /* Bootstrap mappings */
    --bs-primary:          var(--sp-accent);
    --bs-primary-rgb:      255, 102, 0;

    /* Z-index */
    --z-sticky:       1020;
    --z-header-bridge:1100;
    --z-dropdown-menu:1200;
    --z-modal:        1300;
    --z-toast:        1400;
}

/* --- BASE --- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--sp-bg);
    color: var(--sp-text);
    font-family: 'Outfit', system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 320px;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    letter-spacing: -0.01em;
    line-height: 1.25;
    font-weight: 700;
    color: var(--sp-primary);
}

a {
    color: var(--sp-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: #cc5200; }

/* --- LAYOUT --- */
.main-page { background-color: var(--sp-bg); }

/* --- BUTTONS --- */
.btn {
    border-radius: var(--sp-radius);
    font-weight: 600;
    transition: all 0.15s ease;
}

/* Primary = orange accent */
.btn-primary {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #ffffff;
    padding: 0.6rem 1.5rem;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #e55a00;
    border-color: #e55a00;
    color: #ffffff;
    filter: none;
}
.btn-primary:active { transform: scale(0.98) translateY(1px); }

/* Secondary = navy */
.btn-secondary {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
    color: #ffffff;
}
.btn-secondary:hover {
    background-color: #002244;
    border-color: #002244;
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--sp-accent);
    border-color: var(--sp-accent);
    transition: all 0.15s ease;
}
.btn-outline-primary:hover {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--sp-primary);
    border-color: var(--sp-primary);
}
.btn-outline-secondary:hover {
    background-color: var(--sp-primary);
    color: #fff;
}

/* Order button variant */
.btn-primary-order {
    color: var(--sp-accent);
    background-color: #ffffff;
    border: 1px solid var(--sp-accent) !important;
    transition: all 0.15s ease;
}
.btn-primary-order:hover {
    background-color: var(--sp-accent);
    color: #ffffff;
    border-color: var(--sp-accent) !important;
}
.btn-primary-order:active,
.btn-primary:active,
.btn-outline-primary:active {
    transform: scale(0.98) translateY(1px);
}

/* --- FORMS --- */
.form-control,
.form-select {
    height: 45px;
    padding: 0.6rem 0.875rem;
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #ffffff;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
    outline: none;
}
.form-check-input:checked {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
}

/* Form floating labels */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    border-color: var(--sp-primary);
}

/* --- BADGES --- */
.badge {
    border-radius: var(--sp-radius);
    font-weight: 600;
    padding: 0.35em 0.7em;
    letter-spacing: 0.02em;
}
.bg-primary { background-color: var(--sp-accent) !important; }
.text-primary { color: var(--sp-accent) !important; }

/* --- CARDS --- */
.card,
.card-custom {
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background-color: var(--sp-surface);
    box-shadow: var(--sp-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.card:hover { box-shadow: var(--sp-shadow-md); }

/* --- PRODUCT CARD --- */
.sp-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sp-product-card:hover {
    box-shadow: var(--sp-shadow-md);
    transform: translateY(-2px);
}
.sp-product-card__image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}
.sp-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    padding: 8px;
}
.sp-product-card:hover .sp-product-card__image img {
    transform: scale(1.05);
}
.sp-product-card__body {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #f0f0f0;
}
.sp-product-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
    margin-bottom: 8px;
    text-decoration: none;
}
.sp-product-card__title:hover { color: var(--sp-accent); }
.sp-product-card__old-price {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    text-decoration: line-through;
    margin-bottom: 2px;
}
.sp-product-card__price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--sp-accent);
    line-height: 1;
}
.sp-product-card__add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    color: var(--sp-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    border-top: 1px solid var(--sp-border);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.sp-product-card:hover .sp-product-card__add-btn,
.sp-product-card__add-btn:hover {
    background: var(--sp-accent);
    color: #ffffff;
}
.sp-product-card__fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    cursor: pointer;
    transition: all 0.15s ease;
}
.sp-product-card__fav-btn:hover {
    background: #fff0eb;
    border-color: #ffb399;
}

/* --- NAVIGATION / HEADER --- */
.sp-header {
    background-color: var(--sp-primary);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sp-header__top {
    padding: 12px 0;
}
.sp-header__logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-decoration: none;
}
.sp-header__logo:hover { color: var(--sp-accent); }
.sp-header__search {
    position: relative;
    flex: 1;
    max-width: 600px;
}
.sp-header__search-input {
    width: 100%;
    height: 40px;
    padding: 0 44px 0 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--sp-radius);
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}
.sp-header__search-input::placeholder { color: rgba(255,255,255,0.55); }
.sp-header__search-input:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.6);
    outline: none;
    box-shadow: none;
}
.sp-header__search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-accent);
    border: none;
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sp-header__search-btn:hover { background: #e55a00; }
.sp-header__icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    background: transparent;
    border: none;
    border-radius: var(--sp-radius);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.sp-header__icon-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}
.sp-header__badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(30%, -30%);
    min-width: 18px;
    height: 18px;
    background: var(--sp-accent);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--sp-primary);
}
.sp-header__nav {
    background-color: rgba(0,0,0,0.18);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sp-header__nav-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
    border-bottom: 2px solid transparent;
}
.sp-header__nav-link:hover {
    color: #ffffff;
    border-bottom-color: var(--sp-accent);
}

/* Dropdown menus */
.sp-dropdown {
    position: relative;
}
.sp-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: var(--z-dropdown-menu);
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow-md);
    min-width: 200px;
    padding: 4px 0;
}
.sp-dropdown:hover .sp-dropdown__menu { display: block; }
.sp-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-text);
    text-decoration: none;
    transition: background 0.12s ease;
}
.sp-dropdown__item:hover {
    background: var(--sp-bg);
    color: var(--sp-accent);
}
.sp-dropdown__header {
    padding: 10px 16px 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sp-primary);
    border-bottom: 1px solid var(--sp-border);
    background: var(--sp-bg);
}
.sp-dropdown__footer {
    padding: 8px;
    border-top: 1px solid var(--sp-border);
}
.sp-dropdown__bridge {
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 8px;
    background: transparent;
    z-index: var(--z-header-bridge);
}

/* --- KATEGORI NAV (ViewComponent) --- */
.kategori-menusu {
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    flex-wrap: wrap;
}
.kategori-menusu .nav-item { white-space: nowrap; }
.kategori-menusu .nav-link {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    display: block;
}
.kategori-menusu .nav-link:hover {
    color: #ffffff;
    border-bottom-color: var(--sp-accent);
}
.dropdown-toggle::after { display: none !important; }

@media (min-width: 1024px) {
    .kategori-menusu .nav-item.dropdown { position: relative; }
    .kategori-menusu .nav-item.dropdown .dropdown-menu {
        display: none !important;
        position: absolute !important;
        left: 0; top: 100%;
        z-index: var(--z-dropdown-menu);
        background: var(--sp-surface);
        border: 1px solid var(--sp-border);
        border-radius: var(--sp-radius);
        border-top: 2px solid var(--sp-accent);
        padding: 4px 0;
        box-shadow: var(--sp-shadow-md);
        min-width: 200px;
        margin-top: 0;
    }
    .kategori-menusu .nav-item.dropdown:hover .dropdown-menu { display: block !important; }
    .kategori-menusu .dropdown-item {
        padding: 9px 16px;
        color: var(--sp-text);
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        display: block;
        transition: background 0.12s ease;
    }
    .kategori-menusu .dropdown-item:hover {
        background-color: var(--sp-bg);
        color: var(--sp-accent);
    }
}

/* Icon dropdown */
.icon-dropdown { position: relative; }
@media (max-width: 991.98px) {
    .icon-dropdown .dropdown-menu { display: none !important; }
}
@media (min-width: 992px) {
    .icon-dropdown::after {
        content: '';
        position: absolute;
        top: 100%; left: -20px; right: -20px;
        height: 8px;
        background: transparent;
        z-index: var(--z-header-bridge);
    }
    .icon-dropdown .dropdown-menu {
        display: none !important;
        position: absolute !important;
        top: calc(100% + 6px) !important;
        right: 0 !important; left: auto !important;
        z-index: var(--z-dropdown-menu) !important;
        margin-top: 0 !important;
        border-radius: var(--sp-radius) !important;
        border: 1px solid var(--sp-border) !important;
        border-top: 2px solid var(--sp-accent) !important;
        background: var(--sp-surface) !important;
        box-shadow: var(--sp-shadow-md) !important;
    }
    .icon-dropdown:hover > .dropdown-menu {
        display: flex !important;
        flex-direction: column;
    }
}

/* --- FOOTER --- */
.sp-footer {
    background-color: var(--sp-primary);
    color: rgba(255,255,255,0.75);
    margin-top: auto;
}
.sp-footer a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}
.sp-footer a:hover { color: var(--sp-accent); }
.sp-footer__divider { border-color: rgba(255,255,255,0.12); }

/* --- BREADCRUMB --- */
.sp-breadcrumb {
    background: var(--sp-surface);
    border-bottom: 1px solid var(--sp-border);
    padding: 10px 0;
}
.sp-breadcrumb a {
    color: var(--sp-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}
.sp-breadcrumb a:hover { color: var(--sp-accent); }
.sp-breadcrumb__sep { color: #d0d0d0; margin: 0 6px; }
.sp-breadcrumb__current {
    color: var(--sp-text);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* --- PAGE HEADER (section titles) --- */
.sp-page-header {
    background: var(--sp-surface);
    border-bottom: 2px solid var(--sp-accent);
    padding: 20px 0;
    margin-bottom: 24px;
}
.sp-page-header h1 {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--sp-primary);
    margin: 0;
}

/* --- FILTER SIDEBAR --- */
.sp-filter {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
}
.sp-filter__section {
    padding: 16px;
    border-bottom: 1px solid var(--sp-border);
}
.sp-filter__section:last-child { border-bottom: none; }
.sp-filter__title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sp-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

/* --- TABLE (modern) --- */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 4px;
}
.table-modern thead th {
    border: none;
    font-weight: 700;
    color: var(--sp-primary);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    padding-bottom: 8px;
    background: transparent;
}
.table-modern tbody tr {
    background-color: var(--sp-surface);
    box-shadow: var(--sp-shadow);
}
.table-modern tbody tr td:first-child {
    border-top-left-radius: var(--sp-radius);
    border-bottom-left-radius: var(--sp-radius);
}
.table-modern tbody tr td:last-child {
    border-top-right-radius: var(--sp-radius);
    border-bottom-right-radius: var(--sp-radius);
}
.table-modern td {
    border: none;
    vertical-align: middle;
    padding: 12px 16px;
}

/* --- QUANTITY CONTROL --- */
.qty-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
    width: fit-content;
}
.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--sp-bg);
    border: none;
    color: var(--sp-text);
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.15s;
    cursor: pointer;
}
.qty-btn:hover { background: var(--sp-border); color: var(--sp-accent); }
.qty-input {
    width: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--sp-border);
    border-right: 1px solid var(--sp-border);
    background: var(--sp-surface);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--sp-text);
    margin: 0;
}
.qty-input:focus { outline: none; }

/* --- ALERT --- */
.alert {
    border-radius: var(--sp-radius);
    border: none;
    box-shadow: var(--sp-shadow);
}

/* --- PAGINATION --- */
.page-link {
    color: var(--sp-accent);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius) !important;
    margin: 0 2px;
    font-weight: 600;
}
.page-link:hover { background-color: var(--sp-bg); color: var(--sp-accent); }
.page-item.active .page-link {
    background-color: var(--sp-accent);
    border-color: var(--sp-accent);
    color: #fff;
}

/* --- PRODUCT DETAIL --- */
.product-gallery-wrapper {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 24px;
    box-shadow: var(--sp-shadow);
}

/* --- SECURE PAYMENT BADGE --- */
.secure-payment {
    background-color: #16a34a;
    border: none;
    border-radius: var(--sp-radius);
    box-shadow: 0 2px 8px rgba(22,163,74,0.15);
}

/* --- BREADCRUMB (Bootstrap override) --- */
.breadcrumb-item a {
    color: var(--sp-text-muted);
    text-decoration: none;
}
.breadcrumb-item.active { color: var(--sp-accent); font-weight: 600; }

/* --- SECTION DIVIDER --- */
.sp-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.sp-section-title h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sp-primary);
    margin: 0;
    padding-left: 12px;
    border-left: 4px solid var(--sp-accent);
}
.sp-section-title a {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sp-accent);
    text-decoration: none;
}
.sp-section-title a:hover { text-decoration: underline; }

/* --- CART PRODUCT NAME --- */
.cart-product-name {
    font-size: 0.8125rem;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- CUSTOM SCROLLBAR --- */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--sp-border); border-radius: 2px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #b0b8c1; }

/* Dark mode kaldırıldı — tek tema aktif */

/* --- SIDEBAR (Account & Legal) — theme-aware active state --- */
.list-group-item.active {
    background-color: var(--sp-accent) !important;
    border-color: var(--sp-accent) !important;
    color: #fff !important;
}
.list-group-item:not(.active):hover {
    color: var(--sp-accent);
    background-color: rgba(255, 102, 0, 0.06);
}
.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}
.list-group-item.active {
    border-left-color: var(--secondary-color) !important;
}
