/*
 * Doobazar E-Commerce - Main Stylesheet
 * =====================================
 * This file imports all component styles and defines global styles.
 */

/* --- Global Scale (110%) --- */
html {
    font-size: 110%;
}

/* --- CSS Variables (Global) --- */
:root {
    /* Brand Colors */
    --primary-blue: #3467ce;
    --dark-blue: #0f1e4f;
    --light-blue: #e6f3fe;
    --sidebar-bg: #eaf6fe;

    /* Accent Colors */
    --hot-pink: #db2777;
    --price-red: #dc2626;
    --star-orange: #f59e0b;
    --success-green: #059669;
    --link-blue: #2563eb;

    /* Neutral Colors */
    --text-dark: #333;
    --text-grey: #666;
    --text-light: #888;
    --card-border: #e5e7eb;
    --bg-light: #f9fafb;

    /* Currency */
    --currency-symbol: "৳";
}

/* --- CSS Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Remove focus outlines on buttons and links */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: none;
}

button:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: none;
}

button:active,
a:active,
button:focus:active {
    outline: none;
    box-shadow: none;
}

/* Remove blue tap highlight on mobile */
button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:focus,
.qty-btn:active {
    outline: none;
    box-shadow: none;
    border-color: #e5e7eb;
}

/* Disabled checkout button */
.checkout-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Open Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        sans-serif;
    background-color: #fff;
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: var(--link-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: none;
}

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

/* Lists */
ul,
ol {
    list-style: none;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

button:focus {
    outline: none;
    box-shadow: none;
}

/* Form Elements */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: none;
}

/* --- Utility Classes --- */

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 15px;
}

.gap-lg {
    gap: 25px;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-blue);
}

.text-success {
    color: var(--success-green);
}

.text-danger {
    color: var(--price-red);
}

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

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

/* Spacing Utilities */
.mt-sm {
    margin-top: 8px;
}
.mt-md {
    margin-top: 15px;
}
.mt-lg {
    margin-top: 25px;
}

.mb-sm {
    margin-bottom: 8px;
}
.mb-md {
    margin-bottom: 15px;
}
.mb-lg {
    margin-bottom: 25px;
}

.py-sm {
    padding-top: 8px;
    padding-bottom: 8px;
}
.py-md {
    padding-top: 15px;
    padding-bottom: 15px;
}
.py-lg {
    padding-top: 25px;
    padding-bottom: 25px;
}

.px-sm {
    padding-left: 8px;
    padding-right: 8px;
}
.px-md {
    padding-left: 15px;
    padding-right: 15px;
}
.px-lg {
    padding-left: 25px;
    padding-right: 25px;
}

/* Display Utilities */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Loading States --- */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 900px) {
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.4s ease-out;
}

/* --- Toast/Alert Messages --- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* --- Button Styles --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: 2px solid var(--primary-blue);
}

.btn-primary:hover {
    background-color: #2a56a8;
    border-color: #2a56a8;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--light-blue);
}

.btn-danger {
    background-color: var(--price-red);
    color: white;
    border: 2px solid var(--price-red);
}

.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Page Title --- */
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 20px;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-grey);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-grey);
}

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

.breadcrumb .separator {
    color: #ccc;
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 600;
}

/* --- Price Formatting --- */
.price {
    font-weight: 700;
}

.price-current {
    font-size: 18px;
    color: var(--text-dark);
}

.price-original {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
}

.price-discount {
    font-size: 13px;
    color: var(--price-red);
    font-weight: 600;
}

/* --- Print Styles --- */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* --- Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1700;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100dvh;
    max-height: 100dvh;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
    z-index: 1701;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    will-change: transform;
}

.cart-sidebar.open {
    transform: translateX(0);
}

body.cart-open {
    overflow: hidden;
}

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

.cart-sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.cart-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef2f7;
    margin-bottom: 12px;
}

.cart-item-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.cart-item-placeholder {
    color: #cbd5f5;
    font-size: 20px;
}

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

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.cart-item-preference {
    font-size: 12px;
    color: #6b7280;
    margin-top: -2px;
}

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

.cart-qty-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
}

.cart-qty-input {
    width: 56px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    color: var(--text-dark);
}

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

.cart-qty-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cart-remove {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-remove:hover {
    background: #fef2f2;
}

.cart-item-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-grey);
}

.cart-item-price {
    font-weight: 800;
    color: var(--text-dark);
}

.cart-item-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-weight: 600;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-grey);
}

.cart-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    color: #d1d5db;
}

.cart-sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--card-border);
    background: #fff;
}

.checkout-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 600px) {
    .cart-sidebar {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* Cart Notification */
.cart-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-notification.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cart-notification.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.cart-notification.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cart-notification.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Cart Quantity Wrapper */
.cart-qty-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
}

/* Cart Item Limit Message */
.cart-item-limit-msg {
    font-size: 12px;
    color: #d97706;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

/* Cart Summary */
.cart-summary {
    margin-bottom: 15px;
}

.cart-savings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--success-green);
}

.cart-savings .savings-amount {
    color: var(--success-green);
    font-weight: 700;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.cart-subtotal span {
    color: var(--text-grey);
}

.cart-subtotal strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
}

/* Quantity Buttons */
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.15s ease;
}

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

/* Quantity Limit Message on Product Page */
.qty-limit-msg {
    font-size: 13px;
    color: #d97706;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-limit-msg::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Add to Cart Button States */
.add-btn {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover:not(:disabled) {
    background: #2a56a8;
}

.add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-btn.added {
    background: #10b981;
}

.add-btn .btn-added {
    display: none;
}

.add-btn.added .btn-text {
    display: none;
}

.add-btn.added .btn-added {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.add-btn.in-cart {
    background: #dc2626;
}

.add-btn.in-cart:hover {
    background: #b91c1c;
}

.add-btn .btn-remove {
    display: none;
}

.add-btn.in-cart .btn-text {
    display: none;
}

.add-btn.in-cart .btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Button Outline Style */
.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--light-blue);
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid #6b7280;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.toast-success {
    border-left-color: #10b981;
}
.toast-success .toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.toast-warning {
    border-left-color: #f59e0b;
}
.toast-warning .toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.toast-error {
    border-left-color: #ef4444;
}
.toast-error .toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.toast-info {
    border-left-color: #3b82f6;
}
.toast-info .toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px -4px 0;
    font-size: 14px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #1f2937;
}

@media (max-width: 480px) {
    .toast-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}
