/* filepath: website_sale_aplicoop/static/src/css/layout/responsive.css */

/**
 * Responsive design breakpoints and adjustments
 * All media queries centralized here for easier maintenance
 * NOTE: products-grid.css has its own breakpoints and should NOT be overridden here
 */

@media (max-width: 992px) {
    /* Cart sidebar */
    .sticky-cart {
        position: static !important;
        margin-top: 2rem;
        width: 100%;
    }

    .cart-items {
        max-height: 400px;
    }

    #cart-items-container {
        width: 100%;
        padding: 0.75rem;
    }

    .list-group-item {
        padding: 0.75rem;
    }

    .list-group-item h6 {
        font-size: 0.95rem;
    }

    .list-group-item strong {
        min-width: 70px;
    }

    .cart-header {
        padding: 1rem;
        width: 100%;
    }

    .cart-header h5 {
        font-size: 1.25rem;
    }

    .cart-title-lg {
        font-size: 1.25rem;
    }

    #save-cart-btn,
    #reload-cart-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }

    .card-header .btn-group {
        gap: 0.5rem !important;
    }

    /* Order list grid */
    .eskaera-orders,
    .eskaera-orders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Header (shared between eskaera and checkout) */
    .eskaera-order-header,
    .checkout-header {
        padding: 1rem;
    }

    .eskaera-order-header h1,
    .checkout-header h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .checkout-title,
    .eskaera-order-header h1 {
        font-size: 1.5rem;
    }

    .checkout-order-name {
        font-size: 1.2rem;
    }

    /* Fix header flex layout for mobile */
    .eskaera-order-header .d-flex,
    .checkout-header .d-flex {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }

    .order-thumbnail-md {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    /* Order info grid */
    .order-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Eskaera page headings */
    .eskaera-page h1 {
        font-size: 2rem;
    }

    .eskaera-page > .container > .row:first-child p {
        font-size: 1.1rem !important;
    }

    /* Order cards */
    .eskaera-order-card {
        min-height: 250px;
    }

    .eskaera-order-card .card-body {
        padding: 0.5rem 0.6rem 0 0.6rem;
        gap: 0.15rem;
    }

    .eskaera-order-card .card-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
    }

    .order-desc-text {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .eskaera-order-card .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .order-thumbnail-sm {
        width: 70px;
        height: 70px;
    }

    .order-thumbnail-md {
        width: 100px;
        height: 100px;
    }

    /* Header with image and text */
    .eskaera-order-card .d-flex {
        gap: 0.75rem !important;
    }

    .eskaera-order-card .card-footer {
        padding: 0.75rem 1rem;
    }

    /* Order list */
    .eskaera-orders,
    .eskaera-orders-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }

    /* Product grid */
    .card-grid {
        grid-template-columns: 1fr;
    }

    /* Product quantity controls */
    .add-to-cart-form .product-qty {
        font-size: 1rem;
        min-width: 50px;
        height: 32px;
        padding: 0.25rem 0.35rem;
    }

    .qty-control .qty-decrease,
    .qty-control .qty-increase {
        height: 32px;
        width: 32px;
        font-size: 0.9rem;
    }

    .add-to-cart-form .add-to-cart-btn {
        height: 36px;
        min-height: 36px;
        padding: 0.35rem 0.5rem;
        font-size: 1rem;
        min-width: 44px;
    }

    .add-to-cart-form .input-group {
        gap: 0.25rem;
    }

    /* Checkout summary */
    .checkout-summary-container {
        padding: 1rem;
        overflow-x: auto;
    }

    .checkout-summary-table {
        font-size: 0.95rem;
        min-width: 500px; /* Prevent table collapse */
    }

    .checkout-summary-table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .checkout-summary-table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .total-amount {
        font-size: 1.5rem;
    }

    .summary-heading {
        font-size: 1.5rem;
    }

    .checkout-actions .btn {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }

    .group-order-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-card .product-image {
        height: 150px;
    }

    .checkout-container {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    /* Cart items */
    .list-group-item.d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .list-group-item h6 {
        font-size: 0.85rem;
        word-break: break-word;
    }

    .list-group-item small {
        font-size: 0.75rem;
    }

    .list-group-item .d-flex {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .list-group-item strong {
        min-width: auto;
        font-size: 0.95rem;
    }

    .list-group-item .remove-from-cart {
        min-width: 28px;
        min-height: 28px;
    }

    .cart-items {
        max-height: 250px;
    }

    .sticky-cart {
        margin-top: 1.5rem;
    }

    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }

    #save-cart-btn,
    #reload-cart-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .card-header .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .card-header .btn-group {
        gap: 0.25rem !important;
    }

    .card-header .btn-group .btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .form-check {
        padding: 1rem 1.5rem !important;
        margin-left: 0 !important;
    }

    .form-check-input {
        margin-left: 0 !important;
        margin-right: 1rem !important;
        flex-shrink: 0;
    }

    .form-check-label[for="home-delivery-checkbox"] {
        font-size: 1rem !important;
        margin-left: 0 !important;
    }

    /* Header */
    .eskaera-order-header,
    .checkout-header {
        padding: 0.75rem;
    }

    .eskaera-order-header h1,
    .checkout-header h1 {
        font-size: 1.25rem;
        padding-bottom: 0.5rem;
    }

    .checkout-title,
    .eskaera-order-header h1 {
        font-size: 1.25rem;
    }

    .checkout-order-name {
        font-size: 1rem;
    }

    .info-label {
        font-size: 0.9rem;
    }

    /* Eskaera page */
    .eskaera-page h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .eskaera-page > .container > .row:first-child {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .eskaera-page > .container > .row:first-child p {
        font-size: 1rem !important;
    }

    /* Order cards */
    .eskaera-order-card {
        min-height: 220px;
    }

    .eskaera-order-card .card-body {
        padding: 0.4rem 0.5rem 0 0.5rem;
    }

    .eskaera-order-card .card-title {
        font-size: 0.85rem;
    }

    .order-desc-text {
        font-size: 0.7rem;
    }

    .eskaera-order-card .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .order-thumbnail-sm {
        width: 60px;
        height: 60px;
    }

    .order-thumbnail-md {
        width: 80px;
        height: 80px;
    }

    /* Order list */
    .eskaera-orders,
    .eskaera-orders-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .eskaera-empty-state {
        padding: 2rem 0.5rem;
    }

    .eskaera-empty-state .alert {
        font-size: 0.95rem;
        padding: 1rem;
    }

    /* Checkout */
    .checkout-summary-container {
        padding: 0.75rem;
    }

    .checkout-summary-table {
        font-size: 0.85rem;
        min-width: 450px;
    }

    .checkout-summary-table thead th {
        padding: 0.5rem 0.35rem;
        font-size: 0.75rem;
    }

    .checkout-summary-table tbody td {
        padding: 0.5rem 0.35rem;
        font-size: 0.85rem;
    }

    .total-amount {
        font-size: 1.3rem;
    }

    .total-label {
        font-size: 1rem;
    }

    .currency {
        font-size: 1rem;
    }

    .summary-heading {
        font-size: 1.25rem;
        padding-left: 0.75rem;
    }

    .checkout-actions .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

/* Product card typography responsive scaling */
@media screen and (min-width: 1600px) {
    .product-tags {
        font-size: 1.1rem !important;
    }

    /* Scale down quantity input for 6-column layout */
    .add-to-cart-form .product-qty {
        font-size: 0.85rem;
        max-width: 55px;
    }

    .add-to-cart-form .qty-decrease,
    .add-to-cart-form .qty-increase {
        font-size: 0.75rem;
        min-width: 28px;
        min-height: 28px;
    }
}

@media screen and (min-width: 1400px) and (max-width: 1599px) {
    .product-tags {
        font-size: 1.25rem !important;
    }

    /* Scale down quantity input for 5-column layout */
    .add-to-cart-form .product-qty {
        font-size: 0.9rem;
        max-width: 60px;
    }

    .add-to-cart-form .qty-decrease,
    .add-to-cart-form .qty-increase {
        font-size: 0.8rem;
        min-width: 30px;
        min-height: 30px;
    }
}

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