/* RUBIN BRAND PALETTE — synced with style guide */
:root {
    --rubin: #941B1E;           /* Primary: Deep Ruby */
    --rubin-rgb: 148, 27, 30;
    --straw: #D4B96F;           /* Straw (white wine accent) */
    --milk: #F9F9F6;            /* Background: Soft Cream */
    --dark-wine: #1A0505;       /* Secondary: Dark Wine */
    --gray-light: #f1f1f1;
    --text-main: #212529;       /* Body text (Bootstrap default) */

    --bs-primary: #941B1E;
    --bs-primary-rgb: 148, 27, 30;
    --bs-secondary: #1A0505;
    --bs-secondary-rgb: 26, 5, 5;
    --bs-body-bg: #F9F9F6;
    --bs-body-color: #212529;
    --bs-body-font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}

/* ── Global ────────────────────────────────────────── */
body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--milk);
    color: var(--text-main);
    line-height: 1.6;
}

/* ── Brand helpers ─────────────────────────────────── */
.text-rubin {
    color: var(--rubin) !important;
}

.bg-rubin {
    background-color: var(--rubin) !important;
    color: #fff !important;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar .nav-link {
    font-weight: 500;
    color: var(--text-main);
    transition: color 0.2s ease;
}
.navbar .nav-link:hover {
    color: var(--rubin);
}

.navbar .nav-link.active {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}

/* ── Buttons ───────────────────────────────────────── */
.btn-rubin {
    background-color: var(--rubin);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-rubin:hover {
    background-color: color-mix(in srgb, var(--rubin), black 10%);
}

/* Override Bootstrap primary button to match brand palette */
.btn-primary {
    --bs-btn-bg: var(--rubin);
    --bs-btn-border-color: var(--rubin);
    --bs-btn-hover-bg: color-mix(in srgb, var(--rubin), black 10%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--rubin), black 10%);
    --bs-btn-active-bg: color-mix(in srgb, var(--rubin), black 15%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--rubin), black 15%);
}

.btn-outline-primary {
    --bs-btn-color: var(--rubin);
    --bs-btn-border-color: var(--rubin);
    --bs-btn-hover-bg: var(--rubin);
    --bs-btn-hover-border-color: var(--rubin);
}

.btn-straw {
    background-color: var(--straw);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
}

.btn-straw:hover {
    background-color: #c0a357;
}

/* ── Cards (global) ────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

/* ── Wine color indicators ─────────────────────────── */
.wine-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
    margin-right: 4px;
}

.wine-color-red,
.wine-color-Червоне {
    background: linear-gradient(135deg, #8B0000, #6B0000);
}
.wine-color-white,
.wine-color-Біле {
    background: linear-gradient(135deg, #F5E6B8, #EEDFA0);
}
.wine-color-rose,
.wine-color-Рожеве {
    background: linear-gradient(135deg, #E8A0B4, #D4839B);
}
.wine-color-orange,
.wine-color-Помаранчеве {
    background: linear-gradient(135deg, #E8954A, #D47F33);
}

/* ── Back link navigation ─────────────────────────── */
a.back-link,
a.back-link:link,
a.back-link:visited {
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: color 0.2s ease;
}
a.back-link:hover {
    color: var(--rubin);
}

/* ── Price tag accent ─────────────────────────────── */
.price-tag {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--rubin);
    letter-spacing: -0.5px;
}

/* ── Product cards (catalog) ───────────────────────── */
.product-card {
    border: none;
    border-radius: 16px;
    border-left: 0px solid var(--rubin);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    min-height: 220px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-left-width: 6px;
}

.product-card-img {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    border-right: 1px solid rgba(0, 0, 0, 0.03);
    min-width: 140px;
    border-radius: 16px 0 0 16px;
}
.product-card-img a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-img img {
    max-height: 242px;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-img .placeholder-icon {
    min-height: 160px;
}

/* Inactive product styling */
.product-inactive {
    filter: grayscale(1) opacity(0.5);
    background-color: var(--gray-light);
}
.product-inactive .price-tag {
    color: #6c757d;
}

/* ── Filter panel ──────────────────────────────────── */
.filter-panel {
    border-radius: 16px;
}
.filter-panel .form-floating > .form-select {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.filter-badge {
    margin-left: 0.5rem;
}

/* ── Tabs (product list) ───────────────────────────── */
.nav-tabs .nav-link.active {
    color: var(--rubin);
    border-bottom-color: var(--rubin);
    font-weight: 600;
}

.nav-tabs .nav-link:hover:not(.active) {
    border-bottom-color: rgba(var(--rubin-rgb), 0.3);
}

/* ── Product detail page ───────────────────────────── */
.product-detail-img {
    text-align: center;
}
.product-detail-img img {
    max-width: 100%;
    max-height: 500px;
    overflow: hidden;
}

.product-detail-img img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Characteristics table */
.table-characteristics td:first-child {
    width: 40%;
    color: #6c757d;
}

/* Breadcrumb links */
.breadcrumb-item a {
    color: var(--rubin);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ── Product Form: Dirty State Banner ─────────────── */
#dirty-state-banner {
    z-index: 1020;
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
}

/* ── Product Form: Barcode Formset Row ────────────── */
.barcode-row {
    transition: opacity 0.2s ease;
}

.barcode-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

/* ── Attachment Carousel (product detail) ─────────── */
.attachment-carousel-img {
    max-height: 450px;
    object-fit: contain;
    cursor: pointer;
}

#attachmentCarousel .carousel-indicators button {
    background-color: var(--rubin);
}

#attachmentCarousel .carousel-control-prev-icon,
#attachmentCarousel .carousel-control-next-icon {
    filter: invert(0.3);
}

.attachment-list-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.attachment-list-item:hover {
    background-color: rgba(var(--rubin-rgb), 0.05);
}

.active-attachment {
    background-color: rgba(var(--rubin-rgb), 0.08) !important;
    border-left: 3px solid var(--rubin);
}

/* ── Attachment Formset (product form) ────────────── */
.attachment-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.attachment-row {
    transition: opacity 0.2s ease;
}

.attachment-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.attachment-order-input {
    width: 70px;
}

/* ── Footer ────────────────────────────────────────── */
footer {
    font-size: 0.9rem;
    color: #555;
}
