/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ─── Header ─────────────────────────────────────────── */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    white-space: nowrap;
}

.logo:hover { color: var(--primary); }

.logo-icon {
    display: flex;
    align-items: center;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--border-light);
    color: var(--primary);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-size: 0.9rem;
}

.nav-dropdown-content a:hover {
    background: var(--border-light);
    color: var(--primary);
}

.nav-dropdown-all {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px !important;
    font-weight: 600;
    color: var(--primary) !important;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--text);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.cart-link:hover {
    background: var(--border-light);
    color: var(--primary);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

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

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { opacity: 0.9; color: white; }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover { opacity: 0.9; color: white; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; color: white; }

.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ─── Forms ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    cursor: pointer;
}

textarea.form-input {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.form-section-title {
    margin: 24px 0 12px;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
}

/* ─── Flash Messages ─────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.flash {
    padding: 12px 40px 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    animation: flashIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.flash-warning { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning); }
.flash-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }

.flash-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
    opacity: 0.7;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── Toast ──────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-dark);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-title {
    color: white;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-payment {
    margin-top: 16px;
}

.footer-payment span {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 8px;
}

.payment-icons {
    display: flex;
    gap: 8px;
}

.footer-bottom {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ─── Section ────────────────────────────────────────── */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
}

.section-link {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ─── Poster Grid ────────────────────────────────────── */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

.poster-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.poster-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition-slow);
}

.poster-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.poster-card-image {
    position: relative;
    display: block;
}

.poster-card-img-wrap {
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--border-light);
}

.poster-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.poster-card:hover .poster-card-img-wrap img {
    transform: scale(1.05);
}

.poster-card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
}

.poster-card-info {
    padding: 16px;
}

.poster-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.poster-card-title a {
    color: var(--text);
}

.poster-card-title a:hover {
    color: var(--primary);
}

.poster-card-price {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.poster-card-btn {
    width: 100%;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.poster-card-btn:hover {
    background: var(--primary-dark);
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-new { background: var(--info-bg); color: var(--info); }
.badge-processing { background: var(--warning-bg); color: #92400e; }
.badge-shipped { background: #e0e7ff; color: #3730a3; }
.badge-delivered { background: var(--success-bg); color: var(--success); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-draft { background: var(--border-light); color: var(--text-light); }
.badge-archived { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-lg { padding: 6px 16px; font-size: 0.85rem; }

/* ─── Pagination ─────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination-link {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.pagination-link:hover,
.pagination-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ─── Back Link ──────────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary);
}

/* ─── Page Title ─────────────────────────────────────── */
.page-title {
    margin-bottom: 32px;
    font-family: var(--font-display);
}

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ─── Legal Section ──────────────────────────────────── */
.legal-section {
    padding: 60px 0;
}

.legal-section h1 {
    font-family: var(--font-display);
    margin-bottom: 8px;
}

.legal-section h2 {
    margin-top: 32px;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.legal-section p, .legal-section ul {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text-light);
}

.legal-section ul {
    padding-left: 24px;
}

/* ─── Error Section ──────────────────────────────────── */
.error-section {
    padding: 100px 0;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}

.error-content h2 {
    margin-bottom: 12px;
}

.error-content p {
    color: var(--text-light);
    margin-bottom: 24px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ─── Checkout Result ────────────────────────────────── */
.checkout-result {
    padding: 80px 0;
}

.result-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 32px;
    border: 1px solid var(--border);
}

.result-icon {
    margin-bottom: 20px;
}

.result-card h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.result-card p {
    color: var(--text-light);
    margin-bottom: 8px;
}

.result-order-id {
    font-weight: 700;
    color: var(--text) !important;
    font-size: 1.1rem;
}

.download-section {
    margin: 24px 0;
    text-align: left;
}

.download-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.download-btn {
    margin-bottom: 8px;
    width: 100%;
    justify-content: center;
}

.print-notice {
    background: var(--warning-bg);
    padding: 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    margin: 20px 0;
}

.print-notice p {
    margin: 0;
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ─── Order styles ───────────────────────────────────── */
.account-section {
    padding: 40px 0;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id {
    font-weight: 700;
    margin-right: 12px;
}

.order-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-weight: 700;
    font-size: 1.1rem;
}

.order-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-new { background: var(--info-bg); color: var(--info); }
.status-processing { background: var(--warning-bg); color: #92400e; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: var(--success-bg); color: var(--success); }
.status-cancelled { background: var(--danger-bg); color: var(--danger); }

.order-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-item-img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.order-item-info {
    flex: 1;
}

.order-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.order-item-format {
    font-size: 0.85rem;
    color: var(--text-light);
}

.order-item-price {
    font-weight: 600;
}

.order-total-line {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 2px solid var(--border);
    font-size: 1.1rem;
}

/* ─── Modal ──────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.modal-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 16px;
    background: var(--border-light);
}
