/* ==========================================================================
   Store-specific layout glue.
   Complements the shared site stylesheet (../css/main.min.css),
   which already defines the look of .card, .product-block, .store-cat-btn,
   .cart-row, .featured-product__*, .custom-deals__*, etc.
   ========================================================================== */

/* Page background, header and navigation come from the shared site header
   (../includes/header.php) and ../css/galanor-theme.css. */

/* Sidebar sticks below the sticky site nav while scrolling the product grid. */
.store-sidebar {
    position: sticky;
    top: calc(var(--g-nav-h, 84px) + 1rem);
}
@media (max-width: 992px) {
    .store-sidebar { position: static; }
}

.cart-total {
    border-top: 1px solid #503921;
    border-bottom: 1px solid #503921;
}
.cart-list .cart-row .remove-cart { line-height: 1; }
.cart-product-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f90;
    font-size: 16px;
}

/* Category buttons: even row that wraps on small screens. */
.store-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.store-cat-nav .store-cat-btn {
    flex: 1 1 auto;
    padding: .85rem 1rem;
    white-space: nowrap;
}
.store-cat-btn i { margin-right: 10px; }

/* Product card: icon left, info right, full-width add button pinned to bottom. */
.product-block {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.product-block .product-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    flex: 1 1 auto;
}
.product-block .product-image {
    margin-left: 0;        /* override the default right-align from main.min.css */
    flex: 0 0 auto;
}
.product-block .product-icon {
    font-size: 34px;
    color: #f90;
}
.product-info { min-width: 0; }
.product-block .add-cart {
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: .6rem 1rem;
}

/* Badges: keep them on the card (main.min.css parks them off to the left). */
.product-block .product-badge {
    left: auto;
    right: 0;
    top: 0;
}

/* Featured + deals icons. */
.featured-product__image i { font-size: 56px; color: #ffdf27; }

/* Wider "Apply" button on the discount-code field (default is a narrow 20%). */
.discount-group .form-control { width: 62%; }
.discount-group .button       { width: 38%; }

/* Checkout modal: give the header the same stone texture as a card header. */
#checkoutModal .modal-header {
    background-image: url("../images/maintitle-bg.jpg");
    background-size: cover;
    background-position: left bottom;
    background-repeat: repeat-x;
    text-shadow: 0px 2px 2px #000;
}
#checkoutModal .modal-title { color: #fff; }
#checkoutModal .modal-body label { display: block; }

/* Terms & Conditions readability. */
.tos h5 {
    color: #f90;
    margin-top: 1.75rem;
    margin-bottom: .75rem;
}
.tos h5:first-of-type { margin-top: 0; }
.tos p { margin-bottom: 1rem; }
.tos ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}
.tos ul li { margin-bottom: .35rem; }

/* ==========================================================================
   Mobile refinements
   ========================================================================== */

/* Trim the ornamental frame padding so cards get more width on phones. */
@media (max-width: 767.98px) {
    .main-container { padding: 8px; }
}

@media (max-width: 575.98px) {
    /* Guard against accidental horizontal scroll from any wide child. */
    body { overflow-x: hidden; }

    /* Reclaim side padding for the store's main content column. */
    main .container { padding-left: 12px; padding-right: 12px; }

    /* Featured product: stack the image above the text and centre it, instead
       of cramming a 120px image next to the heading. */
    .featured-product__background .card-body {
        flex-direction: column !important;
        text-align: center;
        gap: 1rem !important;
    }
    .featured-product__image { height: 96px; width: 96px; }

    /* Category tabs: even two-per-row grid that's comfortable to tap. */
    .store-cat-nav .store-cat-btn {
        flex: 1 1 calc(50% - 3px);
        padding: .7rem .5rem;
        font-size: 13px;
        white-space: normal;
    }
    .store-cat-btn i { margin-right: 6px; }

    /* Tighter product cards + the featured/deals stat rows. */
    .product-block .product-body { padding: .85rem; gap: .85rem; }
}
