/* فروشگاه عقیق — RTL minimal (Digikala-inspired) */

:root {
    --primary: #ef394e;
    --primary-dark: #d32f42;
    --text: #3f4064;
    --text-muted: #81858b;
    --border: #e0e0e6;
    --bg: #f5f5f5;
    --white: #fff;
    --success: #00a049;
    --warning: #f9a825;
    --radius: 8px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    direction: rtl;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo span { color: var(--text); font-weight: 400; }

.search-form {
    flex: 1;
    min-width: 200px;
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.search-form input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-form button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 18px;
    cursor: pointer;
    font-family: inherit;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.header-link:hover { background: var(--bg); }

.header-cart {
    position: relative;
}

.header-cart-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.header-cart-toggle[aria-expanded="true"] {
    background: var(--bg);
}

.header-cart-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(360px, calc(100vw - 24px));
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(63, 64, 100, 0.14);
    z-index: 200;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 480px);
    opacity: 0;
    visibility: hidden;
    margin-top: -8px;
    pointer-events: none;
    transition:
        opacity 0.4s ease,
        visibility 0.4s ease,
        margin-top 0.4s ease;
}

.header-cart-panel[hidden] {
    display: none !important;
}

.header-cart.is-open .header-cart-panel {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
    pointer-events: auto;
}

.header-cart.is-open .header-cart-panel[hidden] {
    display: flex !important;
}

.header-cart-panel-head {
    padding: 12px 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.header-cart-items {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
}

.header-cart-empty,
.header-cart-loading {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-cart-row {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    align-items: center;
}

.header-cart-row + .header-cart-row {
    border-top: 1px solid var(--border);
}

.header-cart-row img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg);
    flex-shrink: 0;
}

.header-cart-row img.product-image-placeholder {
    object-fit: contain;
    padding: 4px;
}

.header-cart-row-body {
    flex: 1;
    min-width: 0;
}

.header-cart-row-body a {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-cart-row-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.header-cart-row-price {
    font-size: 0.85rem;
    margin-top: 4px;
    color: var(--primary);
    font-weight: 600;
}

.header-cart-footer {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.cart-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.cart-badge.is-empty {
    display: none;
}

/* Quantity stepper (− input +) */
.qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    vertical-align: middle;
    direction: ltr;
}

.qty-stepper-btn {
    width: 36px;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.qty-stepper-btn:hover:not(:disabled) {
    background: #ebebef;
    color: var(--primary);
}

.qty-stepper-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-stepper-input,
.qty-stepper .form-control.qty-stepper-input {
    width: 4.6ch;
    min-width: 4.6ch;
    max-width: 4.6ch;
    border: none !important;
    border-radius: 0 !important;
    text-align: center;
    padding: 8px 4px !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
    appearance: textfield;
    font-variant-numeric: tabular-nums;
}

.qty-stepper-input::-webkit-outer-spin-button,
.qty-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-stepper-locked {
    opacity: 0.72;
}

.qty-stepper-locked .qty-stepper-btn {
    cursor: not-allowed;
}

.qty-stepper-locked .qty-stepper-input {
    background: var(--bg);
    cursor: default;
}

/* Main */
.site-main { min-height: 60vh; padding: 24px 0; }

/* Footer */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 32px 0 16px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.footer-title {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1rem;
}

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

.footer-phone-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.footer-phone a {
    display: inline-block;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

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

.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }

.footer-trust {
    display: flex;
    align-items: flex-start;
}

.footer-trust img {
    max-width: 125px;
    height: auto;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

.shop-sort-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0 0 12px;
}

.shop-sort-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.shop-sort-select {
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.4;
    cursor: pointer;
}

.shop-sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Cards & Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg);
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-image img.product-image-placeholder,
.product-gallery-main img.product-image-placeholder,
.cart-item-image img.product-image-placeholder {
    object-fit: cover;
    padding: 0;
    background: linear-gradient(145deg, #faf6f1 0%, #ead5cf 100%);
}

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

.product-card-image .badge {
    top: 8px;
    right: 8px;
    z-index: 1;
}

.product-card-body { padding: 12px; }

.product-card-title {
    font-size: 0.9rem;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: -2px 0 8px;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.product-price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-left: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sold { background: #eee; color: var(--text-muted); }
.badge-sale { background: var(--primary); color: var(--white); }

/* Order status badges (account) */
.order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.order-status-pending-payment { background: #fef3c7; color: #92400e; }
.order-status-paid { background: #dbeafe; color: #1e40af; }
.order-status-processing { background: #e0f2fe; color: #075985; }
.order-status-shipped { background: #cffafe; color: #0e7490; }
.order-status-delivered { background: #dcfce7; color: #166534; }
.order-status-cancelled { background: #fee2e2; color: #991b1b; }
.order-status-refund-pending { background: #ffedd5; color: #9a3412; }
.order-status-refunded { background: #f3f4f6; color: #4b5563; }

.order-meta-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}
.order-tracking {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.order-tracking-code {
    font-weight: 700;
    letter-spacing: 0.02em;
}
.order-history {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}
.order-history-title {
    display: block;
    margin-bottom: 12px;
}
.order-history-table {
    background: var(--white);
}
.order-history-table td {
    vertical-align: middle;
}


.product-sold-banner {
    display: block;
    width: 100%;
    margin: 4px 0 20px;
    padding: 18px 24px;
    border-radius: var(--radius);
    background: #ef394e;
    color: #fff;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 4px 14px rgba(239, 57, 78, 0.35);
}

/* Section */
.section { margin-bottom: 32px; }

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #fff 0%, #fce4ec 100%);
    border-radius: var(--radius);
    padding: 40px 32px;
    margin-bottom: 32px;
    text-align: center;
}

.hero h1 { font-size: 1.8rem; margin: 0 0 12px; }
.hero p { color: var(--text-muted); margin: 0 0 20px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    text-align: center;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--white); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-success { background: var(--success); color: var(--white); }

.btn[hidden] {
    display: none !important;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.15);
}

.form-control-ltr,
.form-control[dir="ltr"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.form-error { color: var(--primary); font-size: 0.85rem; margin-top: 6px; line-height: 1.4; }

.form-input-invalid,
.admin-input-invalid {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.12);
}

.form-group:has(.form-input-invalid) > .form-label,
.admin-form-group:has(.admin-input-invalid) > .admin-form-label {
    color: var(--primary);
}

/* Panel / Card box */
.box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.box-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Auth: login + register side by side */
.auth-page {
    max-width: 920px;
    margin: 24px auto 40px;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
    background: var(--white);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-panel-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 28px 24px;
    min-height: 100%;
}

.auth-panel .box-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.auth-form-footer {
    margin-top: auto;
    padding-top: 8px;
}

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

.auth-captcha-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-captcha-img {
    height: 40px;
    width: 120px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.auth-captcha-refresh {
    flex-shrink: 0;
    min-width: 36px;
    padding: 0 10px;
    height: 40px;
}

.auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 48px;
    background: linear-gradient(180deg, transparent 8%, var(--border) 8%, var(--border) 92%, transparent 92%);
    background-size: 1px 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 8px 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-divider {
        width: auto;
        height: 40px;
        background: linear-gradient(90deg, transparent 8%, var(--border) 8%, var(--border) 92%, transparent 92%);
        background-size: 100% 1px;
        background-position: center;
    }

    .auth-divider span {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 0 12px;
    }

    .auth-panel-inner {
        padding: 22px 18px;
    }
}

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.product-gallery-main {
    aspect-ratio: 1;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info h1 { font-size: 1.4rem; margin: 0 0 12px; }
.product-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.product-specs { margin: 20px 0; }
.product-specs dt { font-weight: 600; margin-top: 8px; }
.product-specs dd { margin: 4px 0 0; color: var(--text-muted); }

/* Table */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data-table th,
table.data-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    background: var(--bg);
    font-weight: 600;
}

table.data-table tr:hover td { background: #fafafa; }

/* Cart */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.cart-layout.is-empty {
    display: none;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
    overflow: hidden;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease,
        max-height 0.4s ease,
        padding 0.4s ease,
        margin 0.4s ease,
        border-width 0.4s ease;
    max-height: 200px;
}

.cart-item.is-removing {
    opacity: 0;
    transform: translateX(16px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-bottom-width: 0;
    pointer-events: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-summary {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-summary-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

/* Checkout steps */
.checkout-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.checkout-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px;
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.checkout-step.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 28px;
    align-items: start;
}

.checkout-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.checkout-address-form-wrap {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.checkout-address-form-wrap[hidden] {
    display: none !important;
}

.checkout-address-form-title {
    margin: 0 0 14px;
    font-size: 1rem;
}

.checkout-address-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkout-address-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--white);
}

.checkout-address-card:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.checkout-address-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.checkout-address-card-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.checkout-shipping-option {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkout-gateway-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkout-gateway-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.checkout-gateway-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.12);
}

.checkout-gateway-option input {
    margin: 0;
    flex-shrink: 0;
}

.checkout-gateway-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.checkout-gateway-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.payment-result-box {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
}

.payment-result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.payment-result-icon.is-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.payment-result-icon.is-error {
    background: #ffebee;
    color: #c62828;
}

.payment-result-lead {
    color: var(--text-muted);
    margin: 0 0 24px;
    line-height: 1.7;
}

.payment-result-card {
    text-align: right;
    background: var(--bg, #f7f7f8);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.payment-result-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.payment-result-row:last-child {
    border-bottom: none;
}

.payment-result-subtitle {
    font-size: 1rem;
    margin: 0 0 10px;
    text-align: right;
}

.payment-result-items ul {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    text-align: right;
}

.payment-result-items li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.checkout-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(63, 64, 100, 0.1);
    display: flex;
    flex-direction: column;
    max-height: min(80vh, 640px);
    position: sticky;
    top: 16px;
}

.checkout-summary-title {
    margin: 0;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.checkout-summary-items {
    overflow-y: auto;
    flex: 1;
}

.checkout-summary-row {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
}

.checkout-summary-row + .checkout-summary-row {
    border-top: 1px solid var(--border);
}

.checkout-summary-row img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg);
    flex-shrink: 0;
}

.checkout-summary-row img.product-image-placeholder {
    object-fit: contain;
    padding: 4px;
}

.checkout-summary-row-body {
    min-width: 0;
    flex: 1;
}

.checkout-summary-row-name {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checkout-summary-row-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.checkout-summary-row-price {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.checkout-summary-footer {
    border-top: 1px solid var(--border);
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkout-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.checkout-summary-total-row.is-total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

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

.address-form-default {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.address-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-address-form-box[hidden] {
    display: none !important;
}

.account-address-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.account-address-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.account-address-card-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.6;
}

.checkout-coupon-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.checkout-coupon-row .form-control {
    flex: 1;
    min-width: 0;
}

.checkout-coupon-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.checkout-coupon-msg {
    margin-top: 6px;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.checkout-review-block {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.checkout-review-block:last-of-type {
    border-bottom: 0;
}

.checkout-review-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.checkout-summary-total-row[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
        max-height: none;
        order: -1;
    }

    .address-form-row {
        grid-template-columns: 1fr;
    }
}

/* Account layout */
.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.account-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.account-sidebar-nav a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.account-sidebar-nav a:hover,
.account-sidebar-nav a.active {
    background: #fce4ec;
    color: var(--primary);
    font-weight: 600;
}

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

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 16px; }

/* Blog */
.post-list-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.post-list-item h2 { margin: 0 0 8px; font-size: 1.1rem; }
.post-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.contact-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #25d366;
    text-decoration: none;
    vertical-align: middle;
}

.contact-whatsapp-link:hover {
    text-decoration: underline;
}

.contact-whatsapp-icon {
    flex-shrink: 0;
    display: block;
}

.form-optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

#contactFormAlert[hidden] {
    display: none !important;
}

/* Invoice */
.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .search-form { order: 3; width: 100%; }
    .header-actions { justify-content: center; }
    .header-cart-panel {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .cart-layout { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .account-layout { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}
