:root {
    --brand: #3b82f6; /* blue-500 */
    --brand-dark: #1e40af; /* blue-900 */
    --ink: #0f172a; /* slate-900 */
    --muted: #64748b; /* slate-500 */
    --bg-soft: #f8fafc; /* slate-50 */
    --radius: 1.25rem;
    --auth-bg-1: #f8fafc;
    --auth-bg-2: #eef2ff;
    --auth-accent: #0d6efd; /* Bootstrap primary */
    --auth-text-muted: #6c757d;
}

body {
    color: var(--ink);
}

/* Header */
.navbar {
    box-shadow: 0 2px 14px rgba(2, 6, 23, .06);
}

.brand-badge {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.signature-canvas-wrapper {
    border: 1px solid #e2e8f0;
}

/* Hero */
.hero {
    background: radial-gradient(1200px 400px at 10% -10%, rgba(59, 130, 246, .18), transparent),
    radial-gradient(900px 300px at 100% 10%, rgba(30, 64, 175, .12), transparent),
    var(--bg-soft);
}

/* Cards */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(2, 6, 23, .08);
}

.price-chip {
    background: #ecf3ff;
    color: var(--brand-dark);
    border-radius: 999px;
    font-weight: 600;
}

.badge-soft {
    background: #eef2ff;
    color: #3730a3;
}

.feature-list i {
    color: var(--brand);
}

.ratio-4x3 {
    aspect-ratio: 4 / 3;
}

.img-cover {
    object-fit: cover;
}

/* Enhanced image styling for proper aspect ratio with height 100% */
.product-card .position-relative {
    min-height: 240px;
    height: 240px;
}

/* Product card images should adjust up to 100% but not exceed container */
.product-card img {
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
}

.product-image-container {
    min-height: 400px;
}

.carousel-inner,
.carousel-item {
    height: 100%;
    min-height: 400px;
}

/* Separate styling for images vs placeholder divs */
.carousel-item img {
    height: 100%;
    width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* Placeholder divs should have fixed height, not stretch to container */
.carousel-item .d-block.bg-light {
    height: auto;
    min-height: 200px;
    width: 100%;
}

/* Sections */
.section-title {
    letter-spacing: .3px;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Footer */
footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .display-5 {
        font-size: 2rem;
    }
}

/* Cart Styles */
.cart-header {
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: #ffffff;
}

.cart-card {
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    transition: box-shadow 0.3s ease;
    border-radius: 8px;
}

.cart-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
}

.price-tag {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.feature i {
    color: var(--brand);
}

.date-pill {
    background: #eef4ff !important;
    color: #0b5ed7 !important;
    border: 1px dashed rgba(13, 110, 253, .35) !important;
}

.installment-box {
    background: #f0f8ff;
    border: 1px solid rgba(13, 110, 253, .15);
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.btn-brand {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: white !important;
}

.btn-brand:hover {
    background: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
    color: white !important;
}

.qty-input {
    max-width: 110px;
}

.divider {
    height: 1px;
    background: rgba(0, 0, 0, .06);
    margin: 20px 0;
}

.item-image {
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.badge-success-custom {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.badge-dark-custom {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

/* Cart Layout Improvements */
.cart-container {
    padding-bottom: 3rem;
}

.cart-item-card {
    margin-bottom: 1.5rem;
    padding: 0;
}

.cart-item-card .card-body {
    padding: 1.5rem;
}

.cart-item-image-wrapper {
    margin-bottom: 1.25rem;
}

.cart-item-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cart-item-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cart-item-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cart-price-section {
    text-align: right;
    min-width: 140px;
}

.cart-features {
    margin-bottom: 1rem;
}

.cart-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.cart-date-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cart-controls {
    margin-top: 1.25rem;
}

.cart-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cart-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-quantity-wrapper .input-group {
    max-width: 130px;
}

.cart-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.cart-summary-card {
    position: sticky;
    top: 1.5rem;
}

.cart-summary-card .card-body {
    padding: 1.5rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cart-summary-total {
    border-top: 1px solid #dee2e6;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-weight: 600;
}

.cart-checkout-section {
    margin-top: 1.25rem;
}

.cart-checkout-button {
    padding: 0.75rem 0;
    font-weight: 600;
}

.cart-notice {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Responsive Improvements */
@media (max-width: 767.98px) {
    .cart-item-card .card-body {
        padding: 1rem;
    }

    .cart-item-header {
        flex-direction: column;
    }

    .cart-price-section {
        text-align: left;
        min-width: auto;
    }

    .cart-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cart-quantity-wrapper {
        justify-content: center;
    }

    .cart-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cart-summary-card {
        position: static;
        margin-top: 1.5rem;
    }
}

/* Required field indicator */
.form-label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

@media (max-width: 575.98px) {
    .cart-container {
        padding-bottom: 2rem;
    }

    .cart-item-image-wrapper {
        margin-bottom: 1rem;
    }

    .item-image {
        height: 400px;
    }

    .cart-badges {
        justify-content: center;
    }

    .cart-date-section {
        justify-content: center;
    }
}

.rules-container div {
    margin-bottom: 10px;
}

.rules-container h2 {
    margin-top: 35px;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.rules-container {
    width: 100% !important;
}

.rules-container.overflow {
    max-height: 400px;
    overflow-x: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    overflow-wrap: break-word !important;
}

.rules-container * {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}

.auth-bg {
    min-height: 100vh;
    background: radial-gradient(1200px 600px at -10% -10%, var(--auth-bg-2), transparent 60%),
    radial-gradient(800px 400px at 110% 10%, var(--auth-bg-2), transparent 55%),
    linear-gradient(180deg, var(--auth-bg-1), #ffffff 65%);
}

.alert.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.auth-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(13, 110, 253, 0.06), 0 6px 18px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.auth-card .card-header {
    border: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, .08), rgba(13, 110, 253, .04));
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    font-weight: 600;
    color: #0d6efd;
}

.form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > label {
    color: #6c757d;
}

.form-control:focus {
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .15);
}

.btn-primary.btn-lg {
    border-radius: .75rem;
}

.help-muted {
    color: var(--auth-text-muted);
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, .08);
}

.small-links a {
    text-decoration: none;
}

.small-links a:hover {
    text-decoration: underline;
}

.sticky-actions {
    position: sticky;
    top: .75rem;
    z-index: 1020;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(4px);
    padding: .5rem .75rem;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: .5rem;
}

.dl-compact dt {
    font-weight: 600;
}

.dl-compact dd {
    margin-bottom: .5rem;
}

.stat {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .75rem;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: .5rem;
}

.stat i {
    font-size: 1.25rem;
    color: #0d6efd;
}

.stat .value {
    font-weight: 700;
}

