/**
 * Custom Styles for Research Compounds E-Commerce
 */

/* ============================================
   Shop Catalog Controls
   ============================================ */
.shop-catalog {
    --shop-accent: #bf2639;
    --shop-ink: #0c1b35;
}

.shop-catalog > .shop-toolbar {
    display: block;
    width: 100%;
    background: #f5f7f9;
    border-top: 1px solid #e5e8ec;
    border-bottom: 1px solid #e5e8ec;
}

.shop-toolbar-row {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.shop-result-count {
    color: #687184;
    font-size: .92rem;
}

.shop-result-count strong {
    color: var(--shop-ink);
}

.shop-sort-form {
    display: flex;
    align-items: center;
    gap: .55rem;
    white-space: nowrap;
}

.shop-sort-form label {
    color: #556071;
    font-size: .88rem;
    font-weight: 700;
}

.shop-sort-form select {
    width: 180px;
    min-height: 42px;
    padding: .45rem 2.2rem .45rem .8rem;
    border: 1px solid #9aa4b2;
    border-radius: 10px;
    background-color: #fff;
    color: var(--shop-ink);
    font-weight: 700;
}

.shop-search-form {
    width: 230px;
    height: 42px;
    display: flex;
    overflow: hidden;
    border: 1px solid #d8dde4;
    border-radius: 999px;
    background: #fff;
}

.shop-search-form input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: .5rem .25rem .5rem 1rem;
    background: transparent;
}

.shop-search-form button {
    width: 42px;
    flex: 0 0 42px;
    border: 0;
    background: transparent;
    color: var(--shop-ink);
}

.shop-catalog > .shop-category-strip {
    display: block;
    width: 100%;
    border-bottom: 1px solid #e5e8ec;
    background: #fff;
}

.category-carousel-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 17px 0;
}

.category-carousel {
    display: flex;
    flex: 1;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.category-carousel::-webkit-scrollbar {
    display: none;
}

.category-pill {
    min-height: 40px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.1rem;
    border: 1px solid #d6d9de;
    border-radius: 999px;
    color: #111827;
    background: #fff;
    text-decoration: none;
    font-size: .85rem;
    scroll-snap-align: start;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.category-pill:hover {
    border-color: var(--shop-accent);
    color: var(--shop-accent);
}

.category-pill.active {
    border-color: var(--shop-accent);
    background: var(--shop-accent);
    color: #fff;
    font-weight: 700;
}

.category-pill-count {
    min-width: 24px;
    padding: .13rem .45rem;
    border-radius: 999px;
    background: #f9dce1;
    color: var(--shop-accent);
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
}

.category-pill.active .category-pill-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.category-carousel-arrow {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 1px solid #d6d9de;
    border-radius: 50%;
    background: #fff;
    color: var(--shop-ink);
}

.category-carousel-arrow:hover:not(:disabled) {
    border-color: var(--shop-accent);
    color: var(--shop-accent);
}

.category-carousel-arrow:disabled {
    opacity: .3;
}

.shop-section-heading {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 12px;
    margin-bottom: 30px;
    border-bottom: 1px solid #dedede;
}

.shop-section-heading h1 {
    margin: 0;
    color: var(--shop-ink);
    font-size: 1.45rem;
    font-weight: 750;
}

.shop-section-heading span {
    color: #788298;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .12em;
}

.shop-search-summary {
    margin: -14px 0 25px;
    color: #687184;
}

.shop-search-summary a {
    margin-left: .4rem;
    color: var(--shop-accent);
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .shop-toolbar-row {
        align-items: stretch;
        flex-direction: column;
        padding: 15px 0;
    }

    .shop-toolbar-row > .d-flex {
        align-items: stretch !important;
        flex-direction: column;
        gap: .75rem !important;
    }

    .shop-search-form,
    .shop-sort-form,
    .shop-sort-form select {
        width: 100%;
    }

    .shop-sort-form select {
        flex: 1;
    }

    .category-carousel-arrow {
        display: none;
    }

    .category-carousel-shell {
        padding: 13px 0;
    }
}

/* ============================================
   Product Cards
   ============================================ */
.product-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.product-card .card-img-top {
    transition: transform 0.3s ease;
}

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

/* ============================================
   Category Cards
   ============================================ */
.category-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
    border-color: var(--bs-primary);
}

/* ============================================
   Category Badges
   ============================================ */
.category-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

/* ============================================
   Purity Badges
   ============================================ */
.purity-badge {
    font-size: 0.75rem;
    font-weight: 600;
}

.purity-badge-lg {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.badge.bg-warning.text-dark {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* ============================================
   Cart Badge
   ============================================ */
.cart-badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   COA Download Button
   ============================================ */
.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.btn-success.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    min-height: 400px;
}

/* ============================================
   Admin Sidebar
   ============================================ */
.sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: var(--bs-primary);
    color: white !important;
}

/* ============================================
   Flash Messages
   ============================================ */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0a3622;
}

.alert-danger {
    background-color: #f8d7da;
    color: #58151c;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    border-left: none;
}

/* ============================================
   Tables
   ============================================ */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0 !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    border-radius: 8px;
}

/* ============================================
   Quantity Input
   ============================================ */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================
   Order Status Badges
   ============================================ */
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* ============================================
   Checkout Form
   ============================================ */
#checkoutForm label {
    font-weight: 500;
}

.payment-section {
    padding-top: 0.25rem;
}

.payment-option {
    display: block;
    border: 2px solid #d7dce5;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background: #fff;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.payment-option.active {
    border-color: #23379d;
    box-shadow: 0 0 0 1px #23379d;
}

.payment-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.payment-card-details {
    border: 1px solid #d7dce5;
    border-radius: 14px;
    padding: 1rem;
    background: #f8f9fb;
}

/* ============================================
   Hero Slider
   ============================================ */
.hero-slider {
    width: 100%;
    height: 56.25vw;
    height: clamp(180px, min(56.25vw, 75svh), 760px);
    min-height: 0;
    position: relative;
    background-color: #111;
    overflow: hidden;
}

/* Slide wrapper — holds background image + gradient overlay */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Gradient overlay — separate layer so it never covers text */
.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.1) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Content always sits above the overlay */
.hero-slide .container {
    position: relative;
    z-index: 2;
}

.hero-slide h1,
.hero-slide p,
.hero-slide .badge,
.hero-slide .btn {
    position: relative;
    z-index: 2;
}

.hero-slide,
.hero-slide h1,
.hero-slide p,
.hero-slide .badge,
.hero-slide .btn,
.hero-slide a {
    color: #fff;
}

/* Navigation controls */
.hero-slide-controls {
    z-index: 10;
}

.hero-slide-controls button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    padding: 0;
    border: 2px solid rgba(255,255,255,.5);
    background: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hero-slide-controls button.active {
    background: #fff;
    border-color: #fff;
    transform: scale(1.2);
    opacity: 1;
}

.hero-slide-controls button:hover {
    opacity: 1;
    border-color: #fff;
}

/* Arrow navigation */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.4);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}

.hero-arrow:hover {
    background: rgba(255,255,255,.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-arrow-prev { left: 1.5rem; }
.hero-arrow-next { right: 1.5rem; }

@media (max-width: 1199.98px) {
    .hero-slide {
        background-position: center center;
    }

    .hero-slide h1 {
        font-size: clamp(2.2rem, 6vw, 3.8rem);
    }

    .hero-slide p {
        font-size: clamp(1rem, 2vw, 1.2rem);
    }
}

@media (max-width: 991.98px) {
    .hero-slide .container {
        padding-left: 3rem;
        padding-right: 3rem;
    }

    .hero-arrow {
        width: 42px;
        height: 42px;
    }

    .hero-arrow-prev {
        left: .75rem;
    }

    .hero-arrow-next {
        right: .75rem;
    }
}

@media (max-width: 767.98px) {
    .hero-slider {
        height: 56.25vw;
        height: clamp(180px, min(56.25vw, 68svh), 430px);
    }

    .hero-slide .container {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .hero-slide h1 {
        font-size: clamp(1.75rem, 9vw, 2.6rem);
        line-height: 1.05;
    }

    .hero-slide p {
        font-size: .95rem;
        line-height: 1.4;
        margin-bottom: 1rem !important;
    }

    .hero-slide .btn {
        padding: .55rem .8rem;
        font-size: .85rem;
    }

    .hero-arrow {
        display: none;
    }

    .hero-slider .hero-slide-controls {
        margin-bottom: .65rem !important;
    }

    .hero-slide-controls button {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 380px) {
    .hero-slider {
        height: max(180px, 56.25vw);
        max-height: 68svh;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .hero-slider {
        height: 68svh;
        min-height: 220px;
        max-height: 360px;
    }

    .hero-slide .container {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .hero-slide h1 {
        margin-bottom: .65rem !important;
        font-size: clamp(1.65rem, 6vw, 2.5rem);
    }

    .hero-slide p {
        display: none;
    }
}

@media (min-width: 1800px) {
    .hero-slide {
        background-position: center center;
    }

    .hero-slide .container {
        max-width: 1500px;
    }
}

.topbar {
    font-size: 0.9rem;
}

.topbar .bi {
    margin-right: 0.35rem;
}

.topbar-marquee {
    overflow: hidden;
    white-space: nowrap;
}

.topbar-track {
    width: max-content;
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-left: 100%;
    animation: topbar-scroll-left 24s linear infinite;
    will-change: transform;
}

.topbar-message {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-marquee:hover .topbar-track {
    animation-play-state: paused;
}

@keyframes topbar-scroll-left {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .topbar-track {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0 1rem;
        white-space: normal;
        animation: none;
    }
}

/* ============================================
   Footer Styling
   ============================================ */
footer a {
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #fff !important;
}

/* ============================================
   Badge Animations
   ============================================ */
.badge {
    font-weight: 500;
}

/* ============================================
   Empty States
   ============================================ */
.text-muted i.bi {
    opacity: 0.5;
}

/* ============================================
   Action Buttons Group
   ============================================ */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}
