/* ==========================================================================
   Maria Mattress — Custom Theme Enhancements (Phase 3)
   Bootstrap 5.3 + Brand #2237a3
   ========================================================================== */

:root {
    --brand: #2237a3;
    --brand-dark: #1a2b82;
    --brand-light: #3d56c7;
    --brand-rgb: 34, 55, 163;
    --text-muted: #6c757d;
    --surface: #f8f9fc;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Open Sans', sans-serif;
    color: #2d3748;
}

/* Override legacy template sticky offset (style.css sets top: -150px) */
.sticky-top {
    top: 0 !important;
}

/* Full-screen loader — avoid translate-middle / vh-100 overflow */
#spinner {
    inset: 0;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    z-index: 9999;
}

h1, h2, h3, h4, h5, h6,
.section-title, .hero-title {
    font-family: 'Poppins', sans-serif;
}

/* ---- Top Bar ---- */
.top-bar {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
}

.top-bar i {
    color: rgba(255, 255, 255, 0.6);
}

/* ---- Navigation ---- */
.main-navbar {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    transition: var(--transition);
}

.main-navbar .navbar-brand .brand-logo {
    height: 52px;
    width: auto;
    filter: brightness(0) invert(1);
}

.main-navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    text-decoration: none !important;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    text-decoration: none !important;
    opacity: 0.85;
}

.main-navbar .nav-link.active {
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
}

/* Override legacy style.css double-underline on hover */
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    text-decoration: none !important;
}

.btn-cart {
    border-radius: 50px;
    font-weight: 500;
    padding: 0.45rem 1.25rem !important;
}

.cart-badge {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    transform: translate(25%, -25%) !important;
}

/* ---- Hero (Homepage) ---- */
.hero-section {
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero-section.nhsblue {
    background-color: #2237a3 !important;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.hero-highlight {
    display: inline;
    background: linear-gradient(120deg, #17a2b8 0%, #0dcaf0 100%);
    color: #1a1a2e;
    padding: 0.1rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-item span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-media {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-video,
.feature-video {
    width: 100%;
    border-radius: var(--radius);
    display: block;
}

.hero-media-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- Page Hero (inner pages) ---- */
.page-hero {
    padding: 8rem 0 4rem;
    margin-top: -1px;
    position: relative;
}

.page-hero .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ---- Section Utilities ---- */
.section-tag {
    display: inline-block;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
}

.section-header {
    max-width: 640px;
    margin-bottom: 2.5rem;
}

/* ---- About ---- */
.about-image-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-image {
    transition: transform 0.6s ease;
}

.about-image-wrap:hover .about-image {
    transform: scale(1.03);
}

/* ---- Product Cards ---- */
.product-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    border: 1px solid #eef0f5;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    padding: 1.5rem;
}

.product-card-image img {
    transition: transform 0.5s ease;
    max-height: 220px;
    object-fit: contain;
    width: 100%;
}

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

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #198754;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.badge-out {
    background: #dc3545;
}

.product-card-body {
    padding: 1.5rem;
}

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

.product-title {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0.25rem 0 0.75rem;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.btn-product {
    background: var(--brand);
    color: #fff !important;
    border: 2px solid var(--brand);
    border-radius: 50px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.btn-product:hover:not(:disabled) {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-1px);
}

.btn-product:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-product-outline {
    border: 2px solid var(--brand);
    color: var(--brand);
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-product-outline:hover {
    background: var(--brand);
    color: #fff !important;
}

.unavailable-overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 55, 163, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    border-radius: var(--radius);
}

.product-unavailable:hover .unavailable-overlay {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    text-align: center;
    color: #fff;
    padding: 1.5rem;
}

/* ---- Features ---- */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: var(--transition);
}

.feature-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.feature-item h6 {
    margin-bottom: 0.15rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.feature-item p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.feature-video-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* ---- Testimonials ---- */
.section-testimonials {
    position: relative;
}

.testimonial-card {
    padding: 2rem;
}

.testimonial-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    margin: 0 auto 1.25rem;
}

.testimonial-text {
    color: rgba(255,255,255,0.9);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.testimonial-author {
    color: #fff;
    font-weight: 600;
}

.testimonial-stars {
    color: #ffc107;
    margin-top: 0.5rem;
}

.testimonial-stars i {
    font-size: 0.85rem;
}

/* ---- CTA ---- */
.cta-banner {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
}

/* ---- Explore Cards (Homepage) ---- */
.explore-card {
    display: block;
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid #eef0f5;
    transition: var(--transition);
    height: 100%;
    color: inherit;
}

.explore-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--brand-rgb), 0.2);
}

.explore-card i {
    font-size: 2rem;
    color: var(--brand);
    margin-bottom: 1rem;
}

.explore-card h5 {
    color: var(--brand);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.explore-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
}

/* ---- Contact Cards ---- */
.contact-card {
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    box-shadow: var(--shadow);
}

/* ---- Product Detail Gallery ---- */
.product-gallery {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.gallery-main {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
    transition: var(--transition);
}

.gallery-nav:hover {
    background: var(--brand);
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.gallery-thumb {
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--brand);
}

.product-specs li {
    padding: 0.35rem 0;
    color: #4a5568;
}

.product-detail-info .product-badge {
    position: static;
    font-size: 0.75rem;
}

/* ---- Checkout Steps ---- */
.checkout-steps {
    max-width: 600px;
    margin: 0 auto;
}

.step-item {
    text-align: center;
}

.step-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e9ecef;
    color: #adb5bd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin: 0 auto 0.5rem;
    position: relative;
    transition: var(--transition);
}

.step-item.active .step-icon {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 15px rgba(var(--brand-rgb), 0.4);
}

.step-item.completed .step-icon {
    background: #198754;
    color: #fff;
}

.step-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #fff;
    color: #198754;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #198754;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.step-item.active .step-label {
    color: var(--brand);
    font-weight: 600;
}

.step-connector {
    width: 60px;
    height: 3px;
    background: #e9ecef;
    border-radius: 2px;
}

.step-connector.completed {
    background: #198754;
}

/* ---- Cart ---- */
.cart-table thead th {
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border: none;
    padding: 1rem;
}

.cart-table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-color: #f0f0f5;
}

.cart-item-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    overflow: hidden;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface);
    color: #495057;
    cursor: pointer;
    transition: var(--transition);
}

.qty-btn:hover:not(:disabled) {
    background: var(--brand);
    color: #fff;
}

.qty-input {
    display: inline-block;
    width: 40px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    background: transparent;
    line-height: 32px;
}

.qty-control-sm .qty-btn {
    width: 28px;
    height: 28px;
}

.qty-control-sm .qty-input {
    width: 32px;
    line-height: 28px;
    font-size: 0.85rem;
}

.cart-mobile-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid #f0f0f5;
}

.cart-mobile-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

/* ---- Summary Card ---- */
.summary-card {
    border-radius: var(--radius) !important;
    overflow: hidden;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.95rem;
}

.summary-total {
    font-size: 1.15rem;
    font-weight: 700;
}

.trust-strip {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.payment-info {
    background: var(--surface);
    border: 1px solid #eef0f5;
}

/* ---- Result Pages ---- */
.result-card {
    border-radius: var(--radius) !important;
    padding: 2.5rem 2rem;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.result-icon-success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.result-icon-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.order-ref-badge {
    background: var(--surface);
    border: 2px dashed rgba(var(--brand-rgb), 0.3);
    border-radius: var(--radius);
    padding: 1rem 2rem;
    display: inline-block;
}

.order-ref-badge .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.order-ref-badge strong {
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f5;
    font-size: 0.9rem;
}

.order-items-box {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
}

/* ---- Order Success Page ---- */
.order-success-page .result-card {
    padding: 3.5rem 4rem 3rem;
}

.order-success-page .result-icon {
    margin-bottom: 2rem;
}

.order-success-page .result-title {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.order-success-page .result-lead {
    font-size: 1.1rem;
    line-height: 1.35;
    max-width: 820px;
    margin: 0 auto 2.5rem;
}

.order-success-page .order-ref-badge {
    padding: 1.5rem 2.5rem;
    margin-bottom: 2.5rem;
}

.order-success-page .order-ref-badge .label {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.order-success-page .order-ref-badge strong {
    font-size: 1.6rem;
    line-height: 1.25;
}

.order-success-page .result-details {
    max-width: 550px;
    width: 100%;
    padding: 0 1rem;
    margin-bottom: 2.5rem;
}

.order-success-page .detail-row {
    padding: 0.85rem 0;
    font-size: 1rem;
    line-height: 1.3;
    gap: 2rem;
}

.order-success-page .detail-row span:first-child {
    min-width: 120px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.order-success-page .detail-row span:last-child {
    text-align: right;
    line-height: 1.3;
}

.order-success-page .order-items-box {
    max-width: 550px;
    width: 100%;
    padding: 2rem 2.5rem;
    margin-bottom: 2.5rem;
}

.order-success-page .order-items-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}

.order-success-page .order-success-item {
    padding: 0.85rem 0;
    line-height: 1.3;
}

.order-success-page .order-success-item strong {
    font-size: 1.05rem;
    line-height: 1.3;
    display: block;
    margin-bottom: 0.25rem;
}

.order-success-page .order-success-item small {
    font-size: 0.9rem;
    line-height: 1.3;
}

.order-success-page .order-success-price {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    padding-left: 1.5rem;
    white-space: nowrap;
}

.order-success-page .order-success-divider {
    margin: 1rem 0 1.25rem;
    opacity: 0.15;
}

.order-success-page .summary-row {
    padding: 0.55rem 0;
    font-size: 1rem;
    line-height: 1.3;
}

.order-success-page .summary-total {
    padding-top: 0.85rem;
    margin-top: 0.35rem;
    font-size: 1.15rem;
    line-height: 1.3;
}

.order-success-page .order-success-alert {
    max-width: 820px;
    width: 100%;
    padding: 1.15rem 1.5rem;
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 2.5rem;
}

.order-success-page .result-actions {
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 767.98px) {
    .order-success-page .result-card {
        padding: 2.5rem 1.5rem 2rem;
    }

    .order-success-page .result-title {
        font-size: 1.6rem;
        line-height: 1.25;
    }

    .order-success-page .result-lead {
        font-size: 1rem;
        line-height: 1.35;
        margin-bottom: 2rem;
    }

    .order-success-page .order-items-box {
        padding: 1.5rem 1.25rem;
    }

    .order-success-page .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        padding: 0.75rem 0;
        line-height: 1.3;
    }

    .order-success-page .detail-row span:last-child {
        text-align: left;
        line-height: 1.3;
    }
}

/* ---- Footer ---- */
.site-footer {
    background: #fff;
    border-top: 3px solid var(--brand);
}

.footer-heading {
    font-weight: 700;
    color: #2d3748;
}

.footer-text {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.92rem;
}

.footer-links a,
.footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.92rem;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--brand);
    padding-left: 4px;
}

.footer-contact li {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.footer-contact i {
    color: var(--brand);
    margin-top: 3px;
    min-width: 16px;
}

.trust-badge {
    background: var(--surface);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--brand);
    border: 1px solid rgba(var(--brand-rgb), 0.15);
}

.footer-bottom {
    background: var(--surface);
    border-top: 1px solid #eef0f5;
}

/* ---- Buttons override ---- */
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--brand-rgb), 0.3);
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 5rem 0 3rem;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .main-navbar .navbar-brand .brand-logo {
        height: 42px;
    }

    .page-hero {
        padding: 7rem 0 3rem;
    }
}

@media (max-width: 575.98px) {
    .result-card {
        padding: 1.5rem 1rem;
    }

    .order-ref-badge strong {
        font-size: 1.1rem;
    }
}
