/* ==========================================================================
   Dinoyo Camera - Components (Modals, Drawers, Cart, Checkout, Invoices, Toast)
   Aesthetics: Neo-Brutalism
   ========================================================================== */

/* ==========================================================================
   Backdrop & Overlay System
   ========================================================================== */
.drawer-backdrop, .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 16px 16px;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

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

/* ==========================================================================
   Offcanvas Drawers (Cart & Wishlist)
   ========================================================================== */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    border-left: 3px solid var(--border-color);
    box-shadow: -6px 0 0 rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--transition-normal), visibility var(--transition-normal);
}

.drawer.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.drawer.drawer-left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 3px solid var(--border-color);
    box-shadow: 6px 0 0 rgba(0, 0, 0, 0.3);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
}

.drawer.drawer-left.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

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

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

.drawer-title-wrap h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
}

.drawer-close-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 2.5px solid var(--border-color);
    box-shadow: 2.5px 2.5px 0px var(--border-color);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.drawer-close-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.drawer-close-btn:hover {
    background: #ff3b30;
    color: #ffffff;
    border-color: var(--border-color);
    transform: translate(-2px, -2px) rotate(90deg);
    box-shadow: 4px 4px 0px var(--border-color);
}

.drawer-close-btn:active {
    transform: translate(1px, 1px) rotate(90deg);
    box-shadow: 0px 0px 0px var(--border-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: 2px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
    position: relative;
    transition: all var(--transition-fast);
}

.cart-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translate(-1px, -1px);
}

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

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

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

.cart-item-price {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-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-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

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

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

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

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

.btn-remove-item:hover {
    color: var(--danger);
    text-decoration: underline;
}

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

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

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

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

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

.bill-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bill-row.total {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-primary);
    padding-top: 10px;
    border-top: 2px solid var(--border-color);
}

.bill-row.total span:last-child {
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--primary);
    color: #000000;
    padding: 2px 8px;
    border: 1.5px solid var(--border-color);
    box-shadow: 2px 2px 0px var(--border-color);
}

/* ==========================================================================
   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: 3px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.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: 2.5px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 900;
    text-transform: uppercase;
}

.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: #000000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.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: var(--radius-xs);
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    background: #000000;
    transition: all var(--transition-fast);
}

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

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

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

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

.spec-table td {
    padding: 10px 12px;
}

.spec-table td:first-child {
    background: var(--bg-card);
    color: var(--text-muted);
    width: 38%;
    font-weight: 800;
    text-transform: uppercase;
    font-family: var(--font-heading);
    border-right: 1.5px solid var(--border-color);
}

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

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

.checkout-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 900;
    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: 2px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    margin-bottom: 10px;
    transition: all var(--transition-fast);
}

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

.courier-option-card.selected, .payment-option-card.selected {
    border-color: var(--border-color);
    background: var(--primary);
    color: #000000;
    box-shadow: var(--shadow-sm);
    transform: translate(-1px, -1px);
}

.courier-option-card.selected .courier-name,
.payment-option-card.selected .payment-name,
.courier-option-card.selected .courier-price {
    color: #000000 !important;
}

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

.courier-name, .payment-name {
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
}

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

.courier-price {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.checkout-summary-box {
    background: var(--bg-card);
    border: 2.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 20px;
}

/* ==========================================================================
   Digital Invoice Modal & Print View
   ========================================================================== */
.invoice-container {
    background: #ffffff;
    color: #000000;
    padding: 36px;
    border-radius: var(--radius-sm);
    border: 2.5px solid #000000;
    box-shadow: var(--shadow-lg);
    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;
    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: var(--accent-green);
    color: #000000;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: var(--radius-xs);
    border: 2px solid #000000;
    box-shadow: 2px 2px 0px #000000;
    font-size: 0.82rem;
    margin-top: 6px;
    text-transform: uppercase;
}

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

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

.invoice-table td {
    padding: 10px 12px;
    border-bottom: 1.5px solid #000000;
    font-size: 0.9rem;
    font-weight: 600;
}

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

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

.toast-success {
    border-left: 8px solid var(--accent-green);
    background: var(--bg-surface);
}

.toast-error {
    border-left: 8px solid var(--danger);
    background: var(--bg-surface);
}

.toast-info {
    border-left: 8px solid var(--secondary);
    background: var(--bg-surface);
}

.toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* ==========================================================================
   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: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--accent-green);
    color: #000000 !important;
    border: 2.5px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.floating-whatsapp-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
    background: #00C853;
}

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