/* =========================================
   Design Tokens
   ========================================= */
:root {
  --color-primary: #6B1E3B;

  --color-error: #dc2626;
  --color-text-primary: #1e293b;
  --color-text-dark: #334155;
  --color-text-secondary: #94a3b8;
  --color-text-subtle: #64748b;
  --color-text-muted: #6c757d;
  --color-text-badge: #475569;
  --color-border: #e2e8f0;
  --color-bg-light: #f1f5f9;
  --color-surface: #ffffff;
  --color-badge-bg: #eef2ff;
  --color-thumb-bg: #f8fafc;
  --color-placeholder-bg: #e9ecef;
  --color-card-border: #dee2e6;
  --color-shadow: rgba(0, 0, 0, 0.25);
}

/* =========================================
   Body background (vinho extra-fraco)
   ========================================= */
body {
    background-color: #fbf4f6;
}

/* Prevent Alpine.js FOUC */
[x-cloak] {
    display: none !important;
}


/* =========================================
   Bootstrap Overrides
   ========================================= */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: #531429;
    border-color: #531429;
}

.btn-primary:active,
.btn-primary.active {
    background-color: #3d0f1e;
    border-color: #3d0f1e;
}

/* External login buttons */
.btn-primary .icon-google {
    vertical-align: middle;
    margin-right: 0.35rem;
}

/* =========================================
   Logo / Brand
   ========================================= */
.navbar-brand-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: #6B1E3B;
}

/* =========================================
   Product card styles
   These are specific to the product display
   and are NOT covered by Bootstrap.
   ========================================= */

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.0rem;
}

@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product card */
.product-card {
    background-color: var(--color-surface);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--color-card-border);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card__image-wrap {
    aspect-ratio: 2 / 3;
    overflow-y: auto;
    background-color: var(--color-placeholder-bg);
    display: flex;
    flex-direction: column;
}

.product-card__main-image {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.product-card__main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.product-card__thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 3px;
    background: var(--color-thumb-bg);
    border-top: 1px solid var(--color-border);
}

.product-card__thumbnail {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 3;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity 0.2s;
}

.product-card__thumbnail:hover {
    opacity: 0.8;
}

.product-card__info {
    padding: 0.75rem 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Out of stock */
.product-card--out-of-stock {
    opacity: 0.5;
    filter: grayscale(0.4);
    position: relative;
    overflow: hidden;
}

.product-card--out-of-stock:hover .product-card__image-wrap img {
    transform: none;
}

.product-card--out-of-stock .product-card__main-image img {
    cursor: default;
}

.product-card--out-of-stock .product-card__thumbnail {
    cursor: default;
}

.product-card--out-of-stock .product-card__image-wrap {
    overflow: hidden;
}

.product-card--out-of-stock .product-card__info {
    pointer-events: none;
}

.product-card__sold-out-stamp {
    position: absolute;
    top: 130px;
    left: 60px;
    z-index: 5;
    transform: rotate(-30deg);
    transform-origin: center;
    background: var(--color-error);
    color: var(--color-surface);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 6px 36px;
    text-transform: uppercase;
    pointer-events: none;
    box-shadow: 0 2px 6px var(--color-shadow);
    white-space: nowrap;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

/* Hover effect for product cards with images */
.product-card[data-images]:hover .product-card__image-wrap img {
    transform: scale(1.03);
    transition: transform 0.2s ease;
}

.product-card[data-images] {
    cursor: pointer;
}

/* =========================================
   Shared card component styles
   (used by both Cliente Index and Catalog Builder)
   ========================================= */

.badge-ref {
    display: inline-block;
    background: var(--color-badge-bg);
    color: var(--color-primary);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-supplier {
    display: inline-block;
    background: var(--color-bg-light);
    color: var(--color-text-badge);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: auto;
}

.card-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-ref-model {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.card-fabric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-top: 0.25rem;
}

.data-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.data-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-secondary);
}

.data-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.data-sub {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.card-colors-list {
    font-size: 0.75rem;
    color: var(--color-text-subtle);
}

.color-value {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.color-value--interactive {
    font-size: inherit;
    color: inherit;
}

.color-swatch {
    display: inline-block;
    width: var(--swatch-size, 1.5rem);
    height: var(--swatch-size, 1.5rem);
    border-radius: 0.2rem;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.card-prices-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 0px;
    min-width: 0;
}

/* =========================================
   Utility overrides
   ========================================= */
.ls-05 {
    letter-spacing: 0.05em;
}

/* =========================================
   Cart Drawer
   ========================================= */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cart-drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #fff;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.cart-drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: #fff;
    flex-shrink: 0;
}

/* Cart items inside drawer */
.cart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-placeholder-bg);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.4rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: background 0.15s;
}

.qty-btn:hover {
    background: var(--color-bg-light);
}

.qty-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.qty-value {
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    font-size: 0.9rem;
}

/* =========================================
   Cart Toggle Button in Navbar
   ========================================= */
.cart-toggle-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* =========================================
   Product Options Modal (Bottom Sheet)
   ========================================= */
.product-options-modal .modal-dialog-bottom {
    display: flex;
    align-items: flex-end;
    min-height: calc(100% - 1rem);
    margin: 0.5rem;
}

.product-options-modal .modal-content {
    border-radius: 16px 16px 0 0;
    border: none;
    max-height: 90vh;
    overflow: hidden;
}

@media (min-width: 768px) {
    .product-options-modal .modal-dialog {
        max-width: 480px;
    }
    .product-options-modal .modal-dialog-bottom {
        align-items: center;
        min-height: calc(100% - 3.5rem);
    }
    .product-options-modal .modal-content {
        border-radius: 16px;
    }
}

.variant-btn {
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 0.85rem;
}

.variant-btn.active {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.stepper-btn {
    border-radius: 10px !important;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   Order Confirmation Page
   ========================================= */
.order-confirmation {
    max-width: 520px;
    margin: 0 auto;
}

.order-success-icon svg {
    display: block;
    margin: 0 auto;
}

.order-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-placeholder-bg);
}

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

/* =========================================
   Nav Icon Button (hamburger, etc.)
   ========================================= */

.nav-icon-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}

/* =========================================
   Orders List Page
   ========================================= */
.order-card-hover:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(107, 30, 59, 0.1);

}

.order-card-hover:active {
    background: var(--color-bg-light);
}

.orders-page .accordion-item,
.orders-page .accordion-body,
.orders-page .order-item {
    max-width: 100%;
}

.orders-page .order-item .card-body,
.orders-page .order-item-details {
    min-width: 0;
    overflow: hidden;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #d7dee7;
    background: #f7fafc;
    color: #264154;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.tag-chip-compact {
    min-height: 1.4rem;
    padding: 0.16rem 0.48rem;
    font-size: 0.7rem;
}

.tag-chip-more {
    background: #eef2f6;
    color: #5c6d7c;
}

.tag-chip[data-tag-color="gray"] {
    background: #eef2f5;
    border-color: #d7dee6;
    color: #51616f;
}

.tag-chip[data-tag-color="green"],
.tag-chip[data-tag-color="tag-success"] {
    background: #e8f7eb;
    border-color: #bfe6c5;
    color: #1f6b34;
}

.tag-chip[data-tag-color="orange"],
.tag-chip[data-tag-color="tag-warning"] {
    background: #fff1e3;
    border-color: #ffd2a6;
    color: #9a4a07;
}

.tag-chip[data-tag-color="red"] {
    background: #fdeced;
    border-color: #f2bec2;
    color: #9d2330;
}

.tag-chip-automatic::before {
    content: "Auto";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: inherit;
    font-size: 0.8rem;
    line-height: 1;
}

/* =========================================
   Toast Notifications
   ========================================= */

.toast-container {
    z-index: 1060;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
}

/* =========================================
   Cart Items - Checkout Mode
   ========================================= */
.cart-items-list--checkout .cart-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    gap: 1.25rem;
}

.cart-items-list--checkout .cart-item:last-child {
    border-bottom: none;
}

.cart-items-list--checkout .cart-item-image {
    width: 88px;
    height: 88px;
    border-radius: 8px;
}

.cart-items-list--checkout .cart-item-title {
    font-size: 1rem;
    white-space: normal;
    overflow: visible;
}

.cart-items-list--checkout .cart-item-variant {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.cart-items-list--checkout .cart-item-price {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cart-items-list--checkout .cart-item-subtotal {
    margin-bottom: 0.5rem;
}

.cart-items-list--checkout .qty-btn {
    width: 36px;
    height: 36px;
}

/* =========================================
   Checkout Page
   ========================================= */
.checkout-page {
    max-width: 960px;
    margin: 0 auto;
}
