/* ==========================================================================
   Dinoyo Camera - Components (Brutalist Modals, Drawers, Cart, Checkout, Invoices)
   ========================================================================== */

/* ==========================================================================
   Backdrop & Overlay System
   ========================================================================== */
.drawer-backdrop, .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.drawer-backdrop.active, .modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Offcanvas Drawers (Cart & Mobile Menu)
   ========================================================================== */
.drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 3.5px solid var(--border-color);
    box-shadow: -8px 0px 0px var(--shadow-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-fast), left var(--transition-fast);
}

[data-theme="light"] .drawer {
    border-left: 3.5px solid #000000;
    box-shadow: -8px 0px 0px #000000;
}

.drawer.active {
    right: 0;
}

.drawer.drawer-left {
    right: auto;
    left: -480px;
    border-left: none;
    border-right: 3.5px solid var(--border-color);
    box-shadow: 8px 0px 0px var(--shadow-color);
}

[data-theme="light"] .drawer.drawer-left {
    border-right: 3.5px solid #000000;
    box-shadow: 8px 0px 0px #000000;
}

.drawer.drawer-left.active {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 3px solid var(--border-color);
    background: var(--bg-card);
}

[data-theme="light"] .drawer-header {
    border-color: #000000;
}

.drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-title-wrap h3 {
    font-size: 1.25rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0;
}

.drawer-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 0px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    box-shadow: 2px 2px 0px var(--shadow-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

[data-theme="light"] .drawer-close-btn {
    border-color: #000000;
    box-shadow: 2px 2px 0px #000000;
}

.drawer-close-btn:hover {
    background: #FF3333;
    color: #ffffff;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--shadow-color);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cart Item Card */
.cart-item {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 2.5px solid var(--border-color);
    padding: 12px;
    border-radius: 0px;
    position: relative;
    box-shadow: 3px 3px 0px var(--shadow-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="light"] .cart-item {
    border-color: #000000;
    box-shadow: 3px 3px 0px #000000;
}

.cart-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--shadow-color);
}

[data-theme="light"] .cart-item:hover {
    box-shadow: 5px 5px 0px #000000;
}

.cart-item-img {
    width: 74px;
    height: 74px;
    border-radius: 0px;
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-size: 0.92rem;
    font-weight: 800;
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 1.3;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--primary);
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.qty-stepper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0px;
    box-shadow: 2px 2px 0px var(--shadow-color);
    overflow: hidden;
}

[data-theme="light"] .qty-stepper {
    border-color: #000000;
    box-shadow: 2px 2px 0px #000000;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-mono);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.qty-btn:hover {
    background: var(--primary);
    color: #000;
}

.qty-number {
    width: 32px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-remove-item:hover {
    color: #FF3333;
}

/* Voucher Form in Cart */
.voucher-section {
    background: var(--bg-card);
    border: 2.5px dashed var(--border-color);
    border-radius: 0px;
    padding: 14px;
    margin-top: 10px;
    box-shadow: 3px 3px 0px var(--shadow-color);
}

[data-theme="light"] .voucher-section {
    border-color: #000000;
    box-shadow: 3px 3px 0px #000000;
}

.voucher-form {
    display: flex;
    gap: 8px;
}

.voucher-input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 0px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: 2px 2px 0px var(--shadow-color);
}

.voucher-badge-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #00FF66;
    border: 2px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 0px;
    font-size: 0.82rem;
    color: #000000;
    font-family: var(--font-mono);
    font-weight: 800;
    box-shadow: 2px 2px 0px var(--shadow-color);
}

.drawer-footer {
    padding: 20px 24px;
    border-top: 3px solid var(--border-color);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-theme="light"] .drawer-footer {
    border-color: #000000;
}

.bill-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.bill-row.total {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
    padding-top: 8px;
    border-top: 2.5px solid var(--border-color);
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.bill-row.total span:last-child {
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 900;
}

/* ==========================================================================
   Modals (Quick View, Checkout, Invoice)
   ========================================================================== */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: 90%;
    max-width: 860px;
    max-height: 90vh;
    background: var(--bg-surface);
    border: 3.5px solid var(--border-color);
    border-radius: 0px;
    box-shadow: 10px 10px 0px var(--shadow-color);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

[data-theme="light"] .modal {
    border-color: #000000;
    box-shadow: 10px 10px 0px #000000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 3px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

[data-theme="light"] .modal-header {
    border-color: #000000;
}

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0;
}

.modal-body {
    padding: 28px;
}

/* Quick View Layout */
.quickview-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 32px;
}

.qv-gallery-main {
    height: 320px;
    background: #000;
    border-radius: 0px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2.5px solid var(--border-color);
    box-shadow: 4px 4px 0px var(--shadow-color);
}

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

.qv-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.qv-thumb {
    width: 60px;
    height: 60px;
    border-radius: 0px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    background: #000;
    box-shadow: 2px 2px 0px var(--shadow-color);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.qv-thumb.active {
    border-color: var(--primary);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--shadow-color);
}

.qv-title {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.85rem;
    border: 2px solid var(--border-color);
}

.spec-table tr {
    border-bottom: 1.5px solid var(--border-color);
}

.spec-table td {
    padding: 10px 12px;
    font-family: var(--font-mono);
}

.spec-table td:first-child {
    color: var(--text-primary);
    width: 38%;
    font-weight: 800;
    background: var(--bg-surface);
}

.spec-table td:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.package-includes-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    margin: 12px 0 20px;
}

.package-includes-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}

.package-includes-list li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 900;
}

/* ==========================================================================
   Checkout Modal & Form
   ========================================================================== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 32px;
}

.checkout-section-title {
    font-size: 1.1rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.courier-option-card, .payment-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 2.5px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 0px;
    cursor: pointer;
    margin-bottom: 10px;
    box-shadow: 3px 3px 0px var(--shadow-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

[data-theme="light"] .courier-option-card, 
[data-theme="light"] .payment-option-card {
    border-color: #000000;
    box-shadow: 3px 3px 0px #000000;
}

.courier-option-card:hover, .payment-option-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--shadow-color);
}

[data-theme="light"] .courier-option-card:hover, 
[data-theme="light"] .payment-option-card:hover {
    box-shadow: 5px 5px 0px #000000;
}

.courier-option-card.selected, .payment-option-card.selected {
    border-color: var(--primary);
    background: var(--bg-surface);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--shadow-color);
}

[data-theme="light"] .courier-option-card.selected, 
[data-theme="light"] .payment-option-card.selected {
    background: #FFE500;
    border-color: #000000;
    box-shadow: 5px 5px 0px #000000;
}

.courier-info, .payment-info {
    flex: 1;
}

.courier-name, .payment-name {
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.courier-desc, .payment-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.courier-price {
    font-size: 0.9rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--primary);
}

[data-theme="light"] .courier-option-card.selected .courier-price,
[data-theme="light"] .payment-option-card.selected .courier-price {
    color: #000000;
}

.checkout-summary-box {
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 0px;
    padding: 20px;
    box-shadow: 5px 5px 0px var(--shadow-color);
}

[data-theme="light"] .checkout-summary-box {
    border-color: #000000;
    box-shadow: 5px 5px 0px #000000;
}

.order-items-scroll {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    font-weight: 700;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-color);
}

/* ==========================================================================
   Digital Invoice Modal & Print View
   ========================================================================== */
.invoice-container {
    background: #ffffff;
    color: #000000;
    padding: 36px;
    border: 3.5px solid #000000;
    border-radius: 0px;
    box-shadow: 8px 8px 0px #000000;
    font-family: var(--font-body);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 3px solid #000000;
    margin-bottom: 24px;
}

.invoice-brand h2 {
    color: #000000;
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.invoice-number-badge {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 800;
}

.invoice-status-paid {
    display: inline-block;
    background: #00FF66;
    color: #000000;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 0px;
    border: 2px solid #000000;
    box-shadow: 2px 2px 0px #000000;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 6px;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    font-family: var(--font-mono);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    border: 2.5px solid #000000;
}

.invoice-table th {
    background: #FFE500;
    color: #000000;
    text-align: left;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 900;
    border-bottom: 2px solid #000000;
    border-right: 1.5px solid #000000;
}

.invoice-table td {
    padding: 10px 12px;
    border-bottom: 1.5px solid #000000;
    border-right: 1.5px solid #000000;
    font-size: 0.88rem;
    font-family: var(--font-mono);
}

.invoice-total-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.invoice-total-box {
    width: 280px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.invoice-grand-total {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #000000;
    border-top: 3px solid #000000;
    padding-top: 8px;
    margin-top: 6px;
}

.invoice-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .invoice-container, .invoice-container * {
        visibility: visible;
    }
    .invoice-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
        box-shadow: none;
        border: 2px solid #000;
    }
    .invoice-actions, .modal-header {
        display: none !important;
    }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 0px;
    box-shadow: 5px 5px 0px var(--shadow-color);
    font-size: 0.92rem;
    font-weight: 800;
    font-family: var(--font-mono);
    animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
}

[data-theme="light"] .toast-item {
    border-color: #000000;
    box-shadow: 5px 5px 0px #000000;
}

.toast-success { border-left: 8px solid #00FF66; }
.toast-error { border-left: 8px solid #FF3333; }
.toast-info { border-left: 8px solid #00F0FF; }

.toast-icon {
    display: flex;
    align-items: center;
    color: var(--primary);
}

.toast-success .toast-icon { color: #00FF66; }
.toast-error .toast-icon { color: #FF3333; }

.toast-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-left: auto;
    cursor: pointer;
    font-weight: 800;
}

.toast-fade-out {
    animation: fadeOutRight 0.25s forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ==========================================================================
   Floating WhatsApp Button Widget
   ========================================================================== */
.floating-whatsapp-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 990;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 12px;
    border-radius: 0px;
    background: #25D366;
    border: 3px solid #000000;
    color: #000000 !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 900;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 5px 5px 0px #000000;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.floating-whatsapp-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0px #000000;
    background: #00FF66;
    color: #000000 !important;
}

.floating-whatsapp-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000000;
}

.floating-wa-icon-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 0px;
    background: #ffffff;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.floating-wa-icon-wrap svg {
    width: 20px;
    height: 20px;
    fill: #000000;
}

.floating-wa-pulse {
    display: none;
}

.floating-wa-text {
    white-space: nowrap;
    letter-spacing: 0.04em;
    padding-right: 4px;
}
