/* ================================================================
   TechDroid Store – E-Commerce Styles
   Extends main.css · Uses the same CSS custom properties
   ================================================================ */

/* ------------------------------------------------
   Store page header (title bar above content)
   ------------------------------------------------ */
.store-page-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 2rem 0;
}

.store-page-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.store-page-header h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb .separator {
    opacity: 0.4;
}

.breadcrumb .current {
    color: var(--color-text);
    font-weight: 500;
}

/* ================================================
   Buttons (store-specific, won't clash with main.css)
   ================================================ */
.btn-store-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.925rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--color-primary);
    color: #fff;
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-store-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-store-primary:active {
    transform: translateY(0);
}

.btn-store-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.925rem;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--color-primary);
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-store-outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    color: #3c4043;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background-color: #f7f8f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-google svg {
    flex-shrink: 0;
}

/* ================================================
   Store Toolbar (search + categories)
   ================================================ */
.store-toolbar {
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Search input */
.search-input-wrap {
    position: relative;
    max-width: 420px;
    width: 100%;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 0.925rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* Category tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 0.45rem 1.1rem;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.category-tab.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ================================================
   Product Grid
   ================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1.5rem 0 3rem;
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Product card */
.product-card {
    position: relative;
    background-color: var(--color-surface);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.product-card .product-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: color-mix(in srgb, var(--color-background) 95%, #888);
}

.product-card .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.06);
}

/* Badges (sale / hot) */
.product-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
    line-height: 1.4;
}

.product-badge.sale {
    background-color: #ef4444;
    color: #fff;
}

.product-badge.hot {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
}

/* Card body */
.product-card .product-info {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-name {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.product-card .product-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-card .product-price-old {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-card .add-to-cart-btn {
    margin-top: auto;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 8px;
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: filter 0.2s, transform 0.15s;
}

.product-card .add-to-cart-btn:hover {
    filter: brightness(1.1);
}

.product-card .add-to-cart-btn:active {
    transform: scale(0.97);
}

/* Empty state */
.products-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
    color: var(--color-text-muted);
}

.products-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.25rem;
    opacity: 0.35;
}

.products-empty p {
    font-size: 1rem;
    max-width: 320px;
}

/* ================================================
   Cart Page
   ================================================ */
.cart-page {
    padding: 2rem 0 4rem;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* Cart items list */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.cart-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cart-item .cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-background) 95%, #888);
    flex-shrink: 0;
}

.cart-item .cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item .cart-item-details {
    min-width: 0;
}

.cart-item .cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item .cart-item-price {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Qty control */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-background);
}

.qty-control button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.qty-control button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.qty-control .qty-value {
    width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    user-select: none;
}

/* Remove button */
.cart-item .remove-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.cart-item .remove-btn:hover {
    background-color: #fef2f2;
    color: #ef4444;
}

@media (max-width: 600px) {
    .cart-item {
        grid-template-columns: 64px 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem 0.75rem;
    }

    .cart-item .cart-item-img {
        width: 64px;
        height: 64px;
        grid-row: 1 / 3;
    }

    .cart-item .qty-control {
        justify-self: start;
    }

    .cart-item .remove-btn {
        justify-self: end;
        grid-column: 2;
    }
}

/* Cart summary sidebar */
.cart-summary {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    font-size: 0.925rem;
    color: var(--color-text-muted);
}

.cart-summary-row.total {
    border-top: 2px solid rgba(0, 0, 0, 0.08);
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.cart-summary .checkout-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.85rem;
    font-size: 1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
    transition: filter 0.2s, transform 0.2s;
}

.cart-summary .checkout-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.cart-summary .checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty cart */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.cart-empty svg {
    width: 96px;
    height: 96px;
    color: var(--color-text-muted);
    opacity: 0.3;
    margin-bottom: 1.25rem;
}

.cart-empty h3 {
    margin-bottom: 0.5rem;
}

.cart-empty p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    max-width: 320px;
}

/* ================================================
   Checkout Page
   ================================================ */
.checkout-page {
    padding: 2rem 0 4rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Form sections */
.form-section {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 1.5rem;
}

.form-section h3 {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3 .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 0.925rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error-msg {
    font-size: 0.78rem;
    color: #ef4444;
    margin-top: 0.3rem;
}

/* Order summary sidebar */
.order-summary-sidebar {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.order-summary-sidebar h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.order-summary-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-height: 320px;
    overflow-y: auto;
}

.order-summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-summary-item .item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-background) 95%, #888);
    flex-shrink: 0;
}

.order-summary-item .item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-summary-item .item-meta {
    flex: 1;
    min-width: 0;
}

.order-summary-item .item-meta .name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-summary-item .item-meta .qty-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.order-summary-item .item-line-total {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.order-summary-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0.5rem 0;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.order-summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    padding-top: 0.75rem;
    border-top: 2px solid rgba(0, 0, 0, 0.08);
    margin-top: 0.25rem;
}

.place-order-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background-color: var(--color-primary);
    color: #fff;
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.place-order-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.place-order-btn:active {
    transform: translateY(0);
}

.place-order-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================================
   Auth / Account Page
   ================================================ */
.auth-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem 1rem 4rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.auth-tab:hover {
    color: var(--color-text);
}

.auth-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.auth-form .form-group {
    margin-bottom: 0.85rem;
}

.auth-form .submit-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.25rem;
}

/* Divider "or" */
.divider-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Profile card */
.profile-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.profile-info {
    margin-bottom: 1.5rem;
}

.profile-info .name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.profile-info .email {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.15rem;
}

.profile-info .phone {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ================================================
   Orders Page
   ================================================ */
.orders-page {
    padding: 2rem 0 4rem;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1.5rem;
    align-items: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.order-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.order-card .order-main {
    min-width: 0;
}

.order-card .order-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.order-card .order-meta {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-card .order-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.order-card .order-total {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
}

/* Order status badge */
.order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.order-status.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.order-status.accepted {
    background-color: #dbeafe;
    color: #1e40af;
}

.order-status.preparing {
    background-color: #ffedd5;
    color: #9a3412;
}

.order-status.ready {
    background-color: #dcfce7;
    color: #166534;
}

.order-status.delivered {
    background-color: #dcfce7;
    color: #166534;
}

.order-status.cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Order detail modal */
.order-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.order-detail-modal.open {
    opacity: 1;
    visibility: visible;
}

.order-detail-modal .modal-content {
    background: var(--color-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(16px);
    transition: transform 0.25s ease;
}

.order-detail-modal.open .modal-content {
    transform: translateY(0);
}

.order-detail-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.order-detail-modal .modal-header h3 {
    font-size: 1.15rem;
    margin: 0;
}

.order-detail-modal .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: background-color 0.2s;
}

.order-detail-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ================================================
   Track Order Page
   ================================================ */
.track-order-page {
    padding: 3rem 0 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.track-form {
    width: 100%;
    max-width: 480px;
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.track-form h2 {
    margin-bottom: 0.5rem;
}

.track-form p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.track-form .form-group {
    text-align: left;
}

.track-form .track-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Track result */
.track-result {
    width: 100%;
    max-width: 560px;
    margin-top: 2rem;
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.track-result .track-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Status timeline */
.status-timeline {
    position: relative;
    padding-left: 2rem;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
}

.timeline-step {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 0.75rem;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-step .timeline-dot {
    position: absolute;
    left: -1.65rem;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-background);
    border: 2px solid rgba(0, 0, 0, 0.15);
    z-index: 1;
    transition: background-color 0.3s, border-color 0.3s;
}

.timeline-step.completed .timeline-dot {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.timeline-step.completed .timeline-dot::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.timeline-step.active .timeline-dot {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.timeline-step .timeline-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 0.15rem;
}

.timeline-step .timeline-time {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.timeline-step.pending .timeline-label {
    color: var(--color-text-muted);
}

/* ================================================
   Cart Link / Badge (header)
   ================================================ */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text);
    transition: color 0.2s;
}

.cart-link:hover {
    color: var(--color-primary);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    transform: translate(25%, -25%);
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* ================================================
   Toast Notifications
   ================================================ */
.td-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #1f2937;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
}

.td-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.td-toast.hiding {
    transform: translateY(120%);
    opacity: 0;
}

.td-toast.success {
    background: #059669;
}

.td-toast.error {
    background: #dc2626;
}

.td-toast.info {
    background: #2563eb;
}

.td-toast-icon {
    display: flex;
    flex-shrink: 0;
}

.td-toast-msg {
    flex: 1;
    line-height: 1.35;
}

.td-toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

.td-toast-close:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

/* ================================================
   General - Loading spinner
   ================================================ */
.store-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: td-spin 0.65s linear infinite;
}

@keyframes td-spin {
    to { transform: rotate(360deg); }
}

.store-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ================================================
   Dark-mode overrides
   ================================================ */
.dark-mode .cart-item:hover,
.dark-mode .order-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.dark-mode .product-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.dark-mode .search-input,
.dark-mode .form-input,
.dark-mode .form-textarea,
.dark-mode .form-select {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .category-tab {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .qty-control {
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .qty-control button:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .cart-item .remove-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

.dark-mode .divider-or::before,
.dark-mode .divider-or::after {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .btn-google {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .btn-google:hover {
    background: #3a3a3a;
}

.dark-mode .auth-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .order-summary-divider {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .order-summary-row.total,
.dark-mode .cart-summary-row.total {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .store-page-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .status-timeline::before {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .timeline-step .timeline-dot {
    background: var(--color-surface);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .order-detail-modal {
    background: rgba(0, 0, 0, 0.7);
}

.dark-mode .order-detail-modal .modal-close {
    background: rgba(255, 255, 255, 0.08);
}

.dark-mode .order-detail-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dark-mode .td-toast {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.dark-mode .store-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
}

/* ================================================
   Responsive fine-tuning
   ================================================ */
@media (max-width: 600px) {
    .store-page-header {
        padding: 1.25rem 0;
    }

    .auth-container {
        padding: 1.5rem;
    }

    .form-section {
        padding: 1.25rem;
    }

    .cart-summary,
    .order-summary-sidebar {
        position: static;
    }

    .order-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .order-card .order-right {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.75rem;
    }

    .track-form,
    .track-result {
        padding: 1.5rem;
    }

    .td-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

/* ================================================
   Animations
   ================================================ */
@keyframes store-fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.store-animate-in {
    animation: store-fadeIn 0.4s ease-out both;
}
