/* 
   v2/css/style.css
   Modern, Premium Webshop CSS
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    /* Color Palette */
    --primary: #FF5A00; /* Vibrant Automotive Orange */
    --primary-hover: #E04E00;
    --secondary: #1F2937; /* Dark Slate */
    --background: #F9FAFB; /* Very light gray */
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-pill: 9999px;
}

html, body {
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* =========================================
   Typography
========================================= */
.text-primary-custom { color: var(--primary) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-primary-custom { background-color: var(--primary) !important; color: #ffffff !important; }

/* =========================================
   Navigation (Glassmorphism Sticky Header)
========================================= */
.navbar-v2 {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all var(--transition-normal);
}

.navbar-v2 .nav-link {
    color: var(--text-main);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color var(--transition-fast);
}

.navbar-v2 .nav-link:hover {
    color: var(--primary);
}

.navbar-brand-v2 img {
    height: 40px;
    object-fit: contain;
}

/* =========================================
   Buttons
========================================= */
.btn-v2-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 14px 0 rgba(255, 90, 0, 0.39);
}

.btn-v2-primary:hover, .btn-v2-primary:focus {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 90, 0, 0.23);
}

.btn-v2-outline {
    background-color: transparent;
    color: var(--secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-v2-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(255, 90, 0, 0.05);
}

/* =========================================
   Search Bar
========================================= */
.search-wrapper-v2 {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input-v2 {
    width: 100%;
    padding: 0.75rem 1.25rem 0.75rem 3rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background-color: var(--background);
    transition: all var(--transition-normal);
    font-size: 0.95rem;
}

.search-input-v2:focus {
    outline: none;
    background-color: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.1);
}

.search-icon-v2 {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* =========================================
   Mobile Header & Search
========================================= */
.mobile-search-form {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    max-width: 450px;
}

.mobile-search-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.mobile-search-wrapper .search-icon-v2 {
    left: 0.85rem;
    font-size: 0.9rem;
}

.mobile-search-input {
    height: 42px;
    padding: 0.45rem 0.75rem 0.45rem 2.35rem;
    font-size: 0.88rem;
    border-radius: var(--radius-pill);
    background-color: var(--background);
    text-overflow: ellipsis;
    min-width: 0;
    width: 100%;
}

.mobile-search-dropdown {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    top: 64px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 75vh !important;
    z-index: 1060 !important;
    overflow-y: auto !important;
    border-radius: var(--radius-md) !important;
}

@media (max-width: 991.98px) {
    .navbar-brand-v2 {
        margin-right: 0.4rem !important;
        padding-top: 0;
        padding-bottom: 0;
    }
    .navbar-brand-v2 img {
        height: 34px;
    }
    .navbar-v2 {
        padding: 0.7rem 0;
    }
    .navbar-v2 .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .navbar-toggler {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .navbar-v2 .navbar-collapse {
        flex-basis: 100% !important;
        width: 100% !important;
        margin-top: 0.75rem;
        padding: 0.85rem 0.5rem;
        border-top: 1px solid var(--border-color);
        background-color: var(--surface);
        border-radius: var(--radius-md);
    }
    .navbar-v2 .navbar-collapse .navbar-nav {
        width: 100%;
        align-items: stretch !important;
    }
    .navbar-v2 .navbar-collapse .nav-item {
        margin: 0.25rem 0 !important;
        width: 100%;
    }
    .navbar-v2 .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none;
        width: 100% !important;
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
        margin-top: 0.4rem;
        background-color: #fafbfc;
    }
}

@media (min-width: 992px) {
    .d-lg-contents {
        display: contents !important;
    }
}

@media (max-width: 991.98px) {
    main.container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 0.5rem !important;
        max-width: 100% !important;
    }
    .hero-section-v2 {
        margin-bottom: 1.5rem !important;
        border-radius: 0.75rem !important;
    }
    .hero-section-v2 .row {
        padding: 1.25rem 0.85rem !important;
        min-height: auto !important;
    }
    .hero-section-v2 h1.display-4 {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    .hero-section-v2 p.lead {
        font-size: 0.92rem !important;
        margin-bottom: 1rem !important;
    }
    .hero-fitment-box {
        padding: 1rem !important;
        border-radius: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    main.container {
        padding-left: 6px !important;
        padding-right: 6px !important;
        padding-top: 0.25rem !important;
    }
    .hero-section-v2 {
        margin-bottom: 1.25rem !important;
        border-radius: 0.75rem !important;
    }
    .hero-section-v2 .row {
        padding: 1rem 0.65rem 0.85rem 0.65rem !important;
    }
    .hero-fitment-box {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .hero-fitment-box form.row {
        margin-left: -0.25rem !important;
        margin-right: -0.25rem !important;
        padding: 0 !important;
    }
    .hero-fitment-box form.row > [class*="col-"] {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    .hero-fitment-box .form-select-lg {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
        font-size: 0.92rem !important;
    }
    .hero-fitment-box button[type="submit"] {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
        font-size: 1rem !important;
    }

    /* Tight mobile product card layout */
    .row.g-4#productGrid,
    .row.g-4:has(> [class*="col-"] > .product-card-v2) {
        --bs-gutter-x: 0.5rem !important;
        --bs-gutter-y: 0.75rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .row.g-4#productGrid > [class*="col-"],
    .row.g-4:has(> [class*="col-"] > .product-card-v2) > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .product-card-v2 {
        border-radius: 0.75rem !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    }
    .product-img-wrapper {
        padding-top: 55% !important; /* Wider aspect ratio so it doesn't take massive vertical space */
        max-height: 200px !important;
    }
    .product-img-wrapper img {
        padding: 0.5rem !important;
    }
    .product-info-v2 {
        padding: 0.75rem 0.85rem !important;
    }
    .product-title-v2 {
        font-size: 0.98rem !important;
        margin-bottom: 0.35rem !important;
        -webkit-line-clamp: 2 !important;
    }
    .product-brand-v2 {
        font-size: 0.7rem !important;
        margin-bottom: 0.15rem !important;
    }
    .product-price-v2 {
        font-size: 1.15rem !important;
        margin-bottom: 0.5rem !important;
    }
    /* Product Page Trust Badges */
    .product-trust-badges .trust-badge-text {
        font-size: 0.72rem;
        line-height: 1.2;
    }
    .product-trust-badges i {
        font-size: 0.9rem;
    }
}

.product-trust-badges .trust-badge-text {
    font-size: 0.82rem;
    line-height: 1.25;
}
.product-trust-badges i {
    font-size: 1rem;
}

@media (max-width: 380px) {
    .navbar-brand-v2 img {
        height: 28px;
    }
    .mobile-search-input {
        height: 38px;
        padding-left: 2rem;
        font-size: 0.82rem;
    }
    .mobile-search-wrapper .search-icon-v2 {
        left: 0.7rem;
        font-size: 0.8rem;
    }
}

/* =========================================
   Product Cards
========================================= */
.product-card-v2 {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: #fff;
    overflow: hidden;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s ease;
}

.product-card-v2:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-info-v2 {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand-v2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.product-title-v2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-v2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
    margin-top: auto;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

/* =========================================
   Badges & Tags
========================================= */
.badge-v2 {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.badge-v2.stock-ok { background-color: #10B981; }
.badge-v2.stock-low { background-color: #F59E0B; }

/* =========================================
   Corner Ribbons (Marketing)
========================================= */
.ribbon-wrapper {
  width: 135px;
  height: 135px;
  overflow: hidden;
  position: absolute;
  top: -1px;
  right: -1px;
  z-index: 10;
  border-top-right-radius: var(--radius-lg);
}

.ribbon {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  font-size: 0.85rem;
  line-height: 28px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  width: 220px;
  display: block;
  color: #fff;
  position: absolute;
  top: 30px;
  right: -60px;
  box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
}

.ribbon.sale { background-color: #dc3545; }
.ribbon.hot { background-color: #ff5722; }
.ribbon.new { background-color: #0d6efd; }

/* =========================================
   Utility Classes
========================================= */
.bg-surface { background-color: var(--surface); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow-custom { box-shadow: var(--shadow-md); }

/* =========================================
   Live Search Dropdown & Custom Scrollbar
========================================= */
#ajaxSearchResults {
    max-height: 480px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 90, 0, 0.4) rgba(0, 0, 0, 0.05);
}

#ajaxSearchResults::-webkit-scrollbar {
    width: 6px;
}

#ajaxSearchResults::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

#ajaxSearchResults::-webkit-scrollbar-thumb {
    background: rgba(255, 90, 0, 0.35);
    border-radius: 8px;
}

#ajaxSearchResults::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =========================================
   Product Page Mobile Segmented Navigation
========================================= */
.product-segmented-nav {
    background: #eef1f5;
    border-radius: 10px;
    padding: 3px;
    display: flex;
    gap: 4px;
    width: 100%;
}

.product-segmented-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.product-segmented-btn i {
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.product-segmented-btn span {
    font-size: 0.76rem;
    text-align: center;
    display: block;
    line-height: 1.2;
}

.product-segmented-btn:hover {
    color: var(--primary);
}

.product-segmented-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Compact padding and table sizes on mobile tab content */
@media (max-width: 767.98px) {
    #productTabsContent {
        padding: 12px 10px !important;
    }
    #productTabsContent table {
        font-size: 0.87rem;
    }
    #productTabsContent .table th,
    #productTabsContent .table td {
        padding: 6px 8px;
    }
    #productTabsContent h3.brand-font {
        font-size: 1.15rem;
        margin-bottom: 0.75rem !important;
    }
    #productTabsContent .product-description-box {
        font-size: 0.94rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }
}

/* =========================================
   Root Price Calculation Hover Popover
========================================= */
.root-calc-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.root-calc-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.root-calc-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.root-calc-template {
    display: none !important;
}

#rootCalcFloatingPopover,
.root-calc-global-popover {
    position: fixed !important;
    z-index: 999999 !important;
    display: none;
    width: 330px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    font-size: 0.75rem;
    color: #212529;
    text-align: left;
    white-space: normal;
    pointer-events: auto;
    animation: rootCalcFadeIn 0.12s ease-out;
}

@keyframes rootCalcFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.root-calc-popover-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 8px 12px;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
}

.root-calc-popover-body {
    padding: 10px 12px;
    background: #ffffff;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
}

.root-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px dashed #edf2f7;
}

.root-calc-row:last-child {
    border-bottom: none;
}

.root-calc-row.highlight-row {
    background-color: #f8fafc;
    margin: 2px -6px;
    padding: 4px 6px;
    border-radius: 4px;
    border-bottom: none;
}

.root-calc-row.total-row {
    background: #eff6ff;
    margin: 4px -6px -2px -6px;
    padding: 6px 6px;
    border-radius: 4px;
    border-top: 1px solid #bfdbfe;
    font-weight: 700;
}

/* ÁSZF List Formatting */
.aszf-container ol.list-alpha {
    list-style: none;
    counter-reset: alpha-counter;
    padding-left: 0;
    margin-bottom: 1.25rem;
}
.aszf-container ol.list-alpha > li {
    counter-increment: alpha-counter;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
}
.aszf-container ol.list-alpha > li::before {
    content: counter(alpha-counter, lower-alpha) ")";
    position: absolute;
    left: 0.25rem;
    font-weight: 700;
    color: var(--secondary, #1f2937);
}
.aszf-container ol.list-alpha-double {
    list-style: none;
    counter-reset: dbl-alpha-counter;
    padding-left: 0;
    margin-top: 0.4rem;
    margin-bottom: 0.75rem;
}
.aszf-container ol.list-alpha-double > li {
    counter-increment: dbl-alpha-counter;
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.4rem;
}
.aszf-container ol.list-alpha-double > li::before {
    content: "a" counter(dbl-alpha-counter, lower-alpha) ")";
    position: absolute;
    left: 0.25rem;
    font-weight: 700;
    color: var(--secondary, #1f2937);
}


