/**
 * COVACA Shopping App - Mobile-First Styles
 * Optimized for mobile devices with bottom navigation
 */

/* ============================================
   AUTH PAGES (Login/Register)
   ============================================ */

.auth-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo h1 {
    font-size: 48px;
    font-weight: 900;
    color: white;
    letter-spacing: -2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.auth-header .logo p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin-top: -5px;
}

.auth-form {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    font-size: 14px;
}

.inline-form {
    display: inline;
}

.auth-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 24px;
}

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

.auth-timer {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* OTP Input */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.1);
    outline: none;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
}

/* ============================================
   APP HEADER
   ============================================ */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: white;
    z-index: 1000;
    height: var(--header-height);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    height: 100%;
}

.header-logo {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
}

.header-search {
    flex: 1;
    margin: 0 12px;
    max-width: 500px;
}

.header-search form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.header-search input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.header-search button {
    background: transparent;
    border: none;
    padding: 10px 12px;
    color: var(--primary);
    cursor: pointer;
}

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

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: white;
    font-size: 11px;
    position: relative;
}

.header-action svg {
    width: 24px;
    height: 24px;
}

.action-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sell-btn {
    background: white;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.sell-btn:hover {
    background: rgba(255,255,255,0.9);
    color: var(--primary);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 1000;
    height: var(--bottom-nav-height);
}

.bottom-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition);
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav svg {
    width: 24px;
    height: 24px;
}

/* Main content spacing */
.main-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

/* ============================================
   CATEGORY SECTION
   ============================================ */

.categories-section {
    background: white;
    padding: 16px 0;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.categories-scroll {
    display: flex;
    gap: 24px;
    padding: 0 16px;
    min-width: max-content;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 70px;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ============================================
   BANNERS & CAROUSEL
   ============================================ */

.banner-section {
    margin-bottom: 16px;
    padding: 0 16px;
}

.banner-slider {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.banner-slide {
    display: none;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   PRODUCT DETAILS PAGE
   ============================================ */

.product-detail-page {
    background: white;
}

.product-gallery {
    position: relative;
    background: var(--bg-secondary);
}

.product-main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: white;
}

.product-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.product-thumb {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.product-thumb.active {
    border-color: var(--primary);
}

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

.product-info {
    padding: 20px 16px;
}

.product-title-large {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.product-rating-large {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.product-price-large {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.price-final {
    font-size: 28px;
    font-weight: 700;
}

.price-mrp {
    font-size: 16px;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.price-off {
    font-size: 16px;
    color: var(--success);
    font-weight: 600;
}

.product-attributes {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

.attribute-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attribute-option {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.attribute-option:hover,
.attribute-option.active {
    border-color: var(--primary);
    background: rgba(40, 116, 240, 0.05);
}

.attribute-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sticky Add to Cart Bar */
.sticky-action-bar {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    z-index: 999;
}

.sticky-action-bar .btn {
    flex: 1;
}

/* ============================================
   CART PAGE
   ============================================ */

.cart-page {
    background: var(--bg-secondary);
    min-height: 100vh;
}

.cart-item {
    background: white;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
}

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

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

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-brand {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
}

.quantity-btn:hover {
    background: var(--border);
}

.quantity-value {
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.cart-summary {
    background: white;
    padding: 20px 16px;
    margin-bottom: 80px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.summary-row.discount {
    color: var(--success);
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 1px dashed var(--border);
    margin-top: 10px;
    padding-top: 16px;
}

.checkout-btn {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
}

.checkout-total {
    font-size: 14px;
}

.checkout-total .amount {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

.checkout-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    padding-bottom: 100px;
}

.checkout-step {
    background: white;
    margin-bottom: 12px;
}

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

.step-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
}

.step-number.completed {
    background: var(--success);
}

.step-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.step-content {
    padding: 16px;
}

.address-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.address-card.selected {
    border-color: var(--primary);
    background: rgba(40, 116, 240, 0.05);
}

.address-card .name {
    font-weight: 600;
    margin-bottom: 4px;
}

.address-card .address {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.payment-method {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(40, 116, 240, 0.05);
}

.payment-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.payment-info {
    flex: 1;
}

.payment-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.payment-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 20px 60px;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    overflow: hidden;
    margin: 0 auto 16px;
    background: white;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-email {
    opacity: 0.9;
    font-size: 14px;
}

.profile-menu {
    background: white;
    border-radius: var(--radius-lg);
    margin: -30px 16px 16px;
    padding: 8px 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.menu-text {
    flex: 1;
    font-size: 15px;
}

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

/* ============================================
   ORDERS PAGE
   ============================================ */

.order-card {
    background: white;
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

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

.order-id {
    font-size: 14px;
    font-weight: 600;
}

.order-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-items {
    padding: 16px;
}

.order-item {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.order-item:last-child {
    margin-bottom: 0;
}

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

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

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

.order-item-name {
    font-size: 14px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-item-price {
    font-weight: 600;
    color: var(--text-primary);
}

.order-footer {
    padding: 16px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-size: 14px;
}

.order-total .amount {
    font-size: 18px;
    font-weight: 700;
}

/* ============================================
   SELL PAGE
   ============================================ */

.sell-form-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    padding-bottom: 80px;
}

.sell-header {
    background: white;
    padding: 20px 16px;
    margin-bottom: 16px;
}

.sell-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.sell-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: rgba(40, 116, 240, 0.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.uploaded-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.uploaded-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

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

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */

.search-page {
    padding-top: var(--header-height);
}

.search-header {
    background: var(--primary);
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar form {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    padding: 10px 12px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
}

.search-bar .back-btn {
    color: white;
    font-size: 24px;
}

.filters-bar {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-height);
    z-index: 100;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

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

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (min-width: 768px) {
    .product-grid {
        gap: 20px;
    }

    .cart-item {
        border-radius: var(--radius);
    }

    .checkout-step,
    .order-card {
        border-radius: var(--radius-lg);
    }

    .sticky-action-bar {
        position: static;
        padding: 20px 16px;
        border-top: none;
    }

    .checkout-btn {
        position: static;
        border-top: none;
        border-radius: var(--radius);
        margin-top: 20px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1400px;
        margin: 0 auto;
    }

    .product-detail-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        padding: 40px;
    }

    .product-gallery {
        position: sticky;
        top: calc(var(--header-height) + 20px);
    }
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
