/* ============================================================================
 * Titans theme — main.css
 *
 * Recreates titans.to (Arctic Titans) visual design on top of WordPress + WooCommerce.
 *
 * Tokens (also exposed as CSS variables so the Customizer can override at runtime):
 *   --t-body-bg:        #ddf5ff   pale arctic blue (extends through header)
 *   --t-card-bg:        #ffffff   white content card
 *   --t-text:           #222222
 *   --t-link:           #171717
 *   --t-link-blue:      #1d3557   navy (utility links + logo wordmark)
 *   --t-nav-bg:         #2d2d2d   dark charcoal nav bar
 *   --t-nav-fg:         #ffffff
 *   --t-accent:         #f15a23   orange (prices, buttons, hover)
 *   --t-out-of-stock:   #c0392b
 *   --t-card-radius:    6px       rounded corners on nav + content card
 *   --t-card-gap:       12px      inset of nav/card from page edges
 *   --t-page-max:       1170px
 *   font:               Tahoma, Geneva, sans-serif
 * ============================================================================ */

:root {
    --t-body-bg:      #ddf5ff;
    --t-card-bg:      #ffffff;
    --t-text:         #222222;
    --t-link:         #171717;
    --t-link-blue:    #1d3557;
    --t-nav-bg:       #2d2d2d;
    --t-nav-fg:       #ffffff;
    --t-accent:       #f15a23;
    --t-accent-dark:  #d94a18;
    --t-out-of-stock: #c0392b;
    --t-card-radius:  6px;
    --t-card-gap:     12px;
    --t-page-max:     1170px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100%; }
body {
    margin: 0;
    font-family: Tahoma, Geneva, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--t-text);
    background-color: var(--t-body-bg);
    padding-top: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--t-link); text-decoration: none; }
a:hover { color: var(--t-accent); }
button { font-family: inherit; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ---------- Page wrapper (centered, transparent — blue bleeds through) ---------- */
.page-wrap {
    max-width: var(--t-page-max);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--t-card-gap);
    box-sizing: border-box;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* ---------- Header (sits on blue body, compact like titans.to) ---------- */
.site-header { padding: 0; background: transparent; }

.header-top {
    display: flex;
    justify-content: flex-end;
    padding: 2px 4px 0;
}
.utility-menu,
.header-utility ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 14px;
    font-size: 12px;
}
.utility-menu a { color: var(--t-link-blue); }
.utility-menu a:hover { color: var(--t-accent); }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
    gap: 16px;
    flex-wrap: wrap;
}
.header-logo { flex: 0 0 auto; }
.header-logo .logo-img { max-height: 130px; width: auto; }

.header-search { flex: 1 1 280px; max-width: 460px; }
.header-search .search-form {
    display: flex;
    align-items: stretch;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(to bottom, #eaf6fc 0%, #c9e1ee 100%);
}
.header-search input[type="search"] {
    flex: 1; min-width: 0;
    border: 0; outline: 0;
    padding: 7px 12px;
    font-size: 14px;
    background: transparent;
    color: var(--t-text);
}
.header-search input[type="search"]::placeholder { color: #8a8a8a; }
.header-search .search-submit {
    background: transparent;
    border: 0;
    border-left: 1px solid #1a1a1a;
    padding: 0 12px;
    cursor: pointer;
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-search .search-submit svg { display: block; }
.header-search .search-submit:hover { color: var(--t-accent); }

.cart-widget { flex: 0 0 auto; }
.cart-widget .cart-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--t-link-blue);
    font-size: 14px;
    line-height: 1;
}
.cart-widget .cart-bag { font-size: 18px; line-height: 1; }
.cart-widget .cart-caret { font-size: 10px; opacity: 0.7; }

/* ---------- Primary nav bar — rounded, inset, sits on blue body ---------- */
.primary-nav {
    background: var(--t-nav-bg);
    border-radius: var(--t-card-radius);
    margin: 0 0 var(--t-card-gap);
    position: relative;
    overflow: hidden;
}
.primary-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap;
}
.primary-menu > li > a,
.primary-menu li a {
    display: block;
    color: var(--t-nav-fg);
    padding: 10px 16px;
    font-size: 13px;
    transition: background 0.12s, color 0.12s;
}
.primary-menu li a:hover,
.primary-menu li.current-menu-item > a {
    background: var(--t-accent);
    color: var(--t-nav-fg);
}
.primary-nav-mobile-bar { display: none; }
.primary-nav-toggle {
    display: none;
    background: transparent; border: 0;
    color: var(--t-nav-fg);
    padding: 10px 14px;
    cursor: pointer;
}
.primary-nav-toggle .bars { display: inline-block; width: 22px; }
.primary-nav-toggle .bars span {
    display: block; height: 2px;
    background: var(--t-nav-fg);
    margin: 4px 0;
}

/* ---------- Content card — white, rounded TOP corners only, fills the
 * remaining viewport height so no blue strip is visible below the content.
 * ---------------------------------------------------------------------- */
.content-card {
    background: var(--t-card-bg);
    border-radius: var(--t-card-radius) var(--t-card-radius) 0 0;
    padding: 20px 24px 60px;
    flex: 1 0 auto;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}

/* ---------- Front page ---------- */
.front-page .welcome-card {
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 14px 20px;
    margin: 0 0 20px;
    text-align: center;
}
.front-page .welcome-heading {
    margin: 0;
    font-size: 14px;
    font-weight: normal;
    color: var(--t-text);
}
.front-page .welcome-body {
    text-align: center;
    margin: 0 0 24px;
    font-size: 13px;
    color: var(--t-text);
}
.front-page .welcome-body p { margin: 0 0 6px; }
.front-page .welcome-body a { color: var(--t-accent); }
.front-page .welcome-body a:hover { text-decoration: underline; }
.home-banner { text-align: center; margin: 0 auto 20px; max-width: 600px; }
.home-banner-img { display: block; margin: 0 auto; max-width: 100%; border-radius: 4px; }

/* Optional Latest Products section on the homepage. */
.home-products {
    margin: 28px 0 8px;
}
.home-products-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--t-text);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--t-accent);
    text-align: left;
}

/* SEO copy added through Pages → Home → Edit renders here. */
.front-page-extra-content {
    margin: 24px auto 0;
    max-width: 820px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--t-text);
}
.front-page-extra-content h1,
.front-page-extra-content h2,
.front-page-extra-content h3,
.front-page-extra-content h4 {
    color: var(--t-text);
    margin: 24px 0 10px;
    line-height: 1.25;
}
.front-page-extra-content h1 { font-size: 22px; }
.front-page-extra-content h2 { font-size: 18px; }
.front-page-extra-content h3 { font-size: 15px; }
.front-page-extra-content p  { margin: 0 0 12px; }
.front-page-extra-content a  { color: var(--t-link-blue); text-decoration: underline; }
.front-page-extra-content a:hover { color: var(--t-accent); }
.front-page-extra-content ul,
.front-page-extra-content ol { padding-left: 22px; margin: 0 0 12px; }
.front-page-extra-content img { margin: 8px auto; border-radius: 4px; }

/* ---------- Static pages ---------- */
.static-page .page-title {
    font-size: 22px; font-weight: bold;
    margin: 0 0 18px; padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--t-text);
}
.static-page .page-content { font-size: 13px; line-height: 1.6; color: var(--t-text); }
.static-page .page-content p { margin: 0 0 12px; }
.static-page .page-content a { color: var(--t-link-blue); text-decoration: underline; }
.static-page .page-content a:hover { color: var(--t-accent); }
.static-page .page-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.static-page .page-content td, .static-page .page-content th { padding: 8px; vertical-align: top; }

/* ---------- Breadcrumb ---------- */
.breadcrumb,
.woocommerce-breadcrumb {
    font-size: 12px;
    margin: 0 0 16px;
    color: #888;
}
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: var(--t-accent); }
.breadcrumb .sep { margin: 0 6px; color: #ccc; }
.home-icon { font-style: normal; }

/* ============================================================================
 * WooCommerce — shop / category / single
 * ============================================================================ */
.woocommerce-products-header .woocommerce-products-header__title,
.woo-main h1 {
    font-size: 20px; font-weight: bold;
    margin: 0 0 12px; color: var(--t-text);
}
.woocommerce-result-count,
.woocommerce-ordering {
    font-size: 12px; color: #555; margin: 0 0 16px;
}
.woocommerce-ordering select {
    padding: 4px 8px; border: 1px solid #ccc;
    border-radius: 3px; font-size: 12px; background: #fff;
}


ul.products {
    list-style: none;
    margin: 0 -10px; padding: 0;
    display: flex; flex-wrap: wrap;
}
ul.products li.product {
    list-style: none;
    width: calc(33.333% - 20px);
    margin: 0 10px 24px;
    padding: 16px;
    text-align: center;
    border: 1px solid #ececec;
    border-radius: 4px;
    background: #fff;
    transition: box-shadow 0.15s;
}
ul.products li.product:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
ul.products li.product .woocommerce-LoopProduct-link,
ul.products li.product a.woocommerce-loop-product__link {
    display: block; color: var(--t-text);
}
ul.products li.product img {
    max-width: 130px; margin: 0 auto 10px;
}
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2,
ul.products li.product h3 {
    font-size: 13px; font-weight: normal;
    color: var(--t-text);
    margin: 0 0 6px; line-height: 1.3;
}
ul.products li.product .product-short-desc {
    font-size: 11px; color: #666; margin: 0 0 6px; min-height: 1em;
}
ul.products li.product .price {
    color: var(--t-accent);
    font-weight: bold; font-size: 14px;
    margin: 4px 0 10px; display: block;
}
ul.products li.product .price del { color: #999; font-weight: normal; }
ul.products li.product .price ins { background: none; }

/* Generic action buttons (single product page, account, breadcrumbs etc.) — orange always. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.btn, .btn-primary, .btn-continue {
    display: inline-block;
    background: var(--t-accent);
    color: #fff !important;
    font-size: 12px; font-weight: bold;
    border: 0; border-radius: 3px;
    padding: 8px 18px;
    cursor: pointer; line-height: 1.2;
    text-transform: none;
    text-decoration: none;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.btn:hover, .btn-primary:hover, .btn-continue:hover {
    background: var(--t-accent-dark);
    color: #fff !important;
}

/* Product-loop Add to Cart: GREY by default, orange on card hover.
   Matches titans.to/bigshop behavior. */
ul.products li.product .button {
    display: inline-block;
    background: #e8e8e8;
    color: #444 !important;
    font-size: 12px; font-weight: bold;
    border: 0; border-radius: 3px;
    padding: 8px 18px;
    cursor: pointer; line-height: 1.2;
    text-transform: none;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
ul.products li.product:hover .button,
ul.products li.product .button:hover {
    background: var(--t-accent);
    color: #fff !important;
}

ul.products li.product .out-of-stock,
.stock.out-of-stock {
    color: var(--t-out-of-stock);
    font-size: 12px; font-weight: bold;
    margin-top: 4px;
}

/* Single product */
.product .images { float: left; width: 38%; }
.product .summary { float: right; width: 58%; }
.product .product_title {
    font-size: 22px; font-weight: bold;
    margin: 0 0 12px; color: var(--t-text);
}
.product .price { color: var(--t-accent); font-weight: bold; font-size: 18px; margin: 0 0 10px; }
.product form.cart { margin: 16px 0; }
.product .quantity input.qty {
    width: 64px; padding: 6px;
    border: 1px solid #ccc; border-radius: 3px;
    font-size: 13px; text-align: center;
}
.product .product_meta { clear: both; margin-top: 24px; font-size: 12px; color: #555; }
.product .product_meta > span { display: block; margin: 4px 0; }

.woocommerce-tabs { clear: both; margin-top: 30px; }
.woocommerce-tabs ul.tabs {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 4px; border-bottom: 1px solid #ddd;
}
.woocommerce-tabs ul.tabs li {
    padding: 8px 16px; background: #f5f5f5;
    border: 1px solid #ddd; border-bottom: 0;
    border-radius: 3px 3px 0 0; font-size: 12px;
}
.woocommerce-tabs ul.tabs li.active { background: #fff; }
.woocommerce-tabs ul.tabs li a { color: var(--t-text); }
.woocommerce-tabs .panel { padding: 16px 4px; }

/* Cart / checkout / account */
.woocommerce table.shop_table {
    width: 100%; border-collapse: collapse;
    margin: 0 0 24px; font-size: 13px;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 12px 8px; border-bottom: 1px solid #eee;
    text-align: left; vertical-align: middle;
}
.woocommerce table.shop_table th { background: #f9f9f9; font-weight: bold; }

.woocommerce form .form-row { display: flex; flex-direction: column; margin: 0 0 12px; }
.woocommerce form .form-row label { font-size: 12px; color: #444; margin-bottom: 4px; }
.woocommerce form .form-row input,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
    padding: 8px; border: 1px solid #ccc;
    border-radius: 3px; font-size: 13px; font-family: inherit;
}

.woocommerce-message, .woocommerce-info, .woocommerce-error {
    padding: 12px 16px; margin: 0 0 16px;
    font-size: 13px; border-radius: 3px;
}
.woocommerce-message { background: #e8f5e9; color: #2e7d32; }
.woocommerce-info    { background: #e3f2fd; color: #1565c0; }
.woocommerce-error   { background: #ffebee; color: #c62828; }

/* ---------- Block-based cart & checkout ----------
 * WC's modern cart/checkout uses Gutenberg blocks whose buttons don't carry
 * .button. Target their specific classes so Proceed to Checkout and Place Order
 * actually match the rest of the theme. */
.wc-block-cart__submit-button,
a.wc-block-cart__submit-button,
.wp-block-woocommerce-proceed-to-checkout-block a,
.wp-block-woocommerce-proceed-to-checkout-block button,
.wc-block-components-checkout-place-order-button,
.wp-block-woocommerce-checkout-actions-block button,
button.wc-block-components-button:not(.is-link):not(.wc-block-components-button--secondary),
a.wc-block-components-button:not(.is-link):not(.wc-block-components-button--secondary) {
    background-color: var(--t-accent) !important;
    background: var(--t-accent) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 3px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    box-shadow: none !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}
.wc-block-cart__submit-button:hover,
a.wc-block-cart__submit-button:hover,
.wp-block-woocommerce-proceed-to-checkout-block a:hover,
.wc-block-components-checkout-place-order-button:hover,
button.wc-block-components-button:not(.is-link):hover,
a.wc-block-components-button:not(.is-link):hover {
    background-color: var(--t-accent-dark) !important;
    background: var(--t-accent-dark) !important;
    color: #fff !important;
}
.wc-block-cart__submit-button span,
.wc-block-components-button__text,
.wp-block-woocommerce-proceed-to-checkout-block a span {
    color: #fff !important;
}
.wc-block-components-totals-wrapper,
.wc-block-cart__totals-title,
.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value {
    color: var(--t-text);
}

/* ============================================================================
 * Account pages — titans.to-style two-column login + register sidebar
 * ============================================================================ */
.titans-account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
}
.titans-account-sidebar {
    background: transparent;
}
.titans-account-sidebar h3 {
    font-size: 16px; font-weight: bold;
    margin: 0 0 8px; padding-bottom: 8px;
    border-bottom: 2px solid var(--t-accent);
    color: var(--t-text);
}
.titans-account-sidebar ul {
    list-style: none; margin: 0; padding: 0;
}
.titans-account-sidebar li a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: var(--t-text);
    font-size: 13px;
}
.titans-account-sidebar li a:hover { color: var(--t-accent); }

.titans-account-title {
    font-size: 26px; font-weight: bold;
    margin: 0 0 18px; color: var(--t-text);
}
.titans-account-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.titans-account-panel {
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-radius: 4px;
    padding: 18px 20px;
}
.titans-account-panel h2 {
    font-size: 18px; font-weight: bold;
    margin: 0 0 12px; padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: var(--t-text);
}
.titans-account-panel h3 { font-size: 14px; margin: 0 0 8px; color: var(--t-text); }
.titans-account-panel p { font-size: 13px; color: #555; margin: 0 0 12px; }
.titans-account-panel input[type="email"],
.titans-account-panel input[type="text"],
.titans-account-panel input[type="password"],
.titans-account-panel input[type="tel"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}
.titans-account-panel .form-row { margin: 0 0 12px; }
.titans-account-panel label { font-size: 12px; color: #444; margin-bottom: 4px; display: block; }
.titans-account-panel .lost_password { font-size: 12px; margin: 8px 0; }
.titans-account-panel .lost_password a { color: var(--t-accent); }

.titans-register-section {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 4px;
    padding: 24px;
}
.titans-register-section h2 {
    font-size: 22px; margin: 0 0 8px; color: var(--t-text);
}
.titans-register-section .lead {
    font-size: 13px; color: #555; margin: 0 0 18px;
}
.titans-register-section fieldset {
    border: 0; padding: 0; margin: 0 0 18px;
}
.titans-register-section legend {
    font-size: 15px; font-weight: bold;
    color: var(--t-text);
    padding-bottom: 8px; margin-bottom: 14px;
    border-bottom: 1px solid #eee; width: 100%;
}
.titans-register-section .form-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.titans-register-section .form-row > label { flex: 0 0 140px; text-align: right; padding-top: 8px; font-size: 12px; color: #444; }
.titans-register-section .form-row > label .required { color: #c0392b; margin-right: 2px; }
.titans-register-section .form-row > .input-wrap { flex: 1; }

/* ---------- 404 ---------- */
.error-404 { padding: 24px 0 80px; }
.error-404 .error-heading {
    font-size: 16px; font-weight: bold;
    margin: 0 0 20px; color: var(--t-text);
    padding-bottom: 10px; border-bottom: 1px solid #eee;
}
.error-404 .error-actions { text-align: right; }


/* ============================================================================
 * Responsive
 * ============================================================================ */
@media (max-width: 980px) {
    ul.products li.product { width: calc(50% - 20px); }
    .product .images, .product .summary { float: none; width: 100%; }
    .titans-account-grid { grid-template-columns: 1fr; }
    .titans-account-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body { padding-top: 4px; }
    .page-wrap { padding: 0 8px; }
    .content-card { padding: 14px 16px 28px; }

    .header-top { justify-content: flex-end; padding: 2px 6px 0; margin: 0; }
    .header-utility ul, .utility-menu { gap: 14px; font-size: 13px; margin: 0; padding: 0; }

    /* Aggressive mobile reset for the header column.
       Override desktop's justify-content: space-between and flex-wrap: wrap so
       they can't re-introduce vertical space between the children. Use explicit
       margin-bottom on each child instead of gap because iOS Safari has been
       observed to mis-distribute `gap` inside flex-column when justify-content
       is set to space-between by a wider rule. */
    .header-main {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 0 4px 4px !important;
        margin: 0 !important;
        height: auto !important;
    }
    .header-main > * {
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        flex: 0 0 auto !important;
    }
    .header-logo {
        text-align: center !important;
        margin: 0 0 2px !important;
    }
    .header-logo .logo-img {
        max-height: 130px;
        margin: 0 auto;
        display: inline-block;
    }
    .header-search {
        width: 100% !important;
        max-width: none !important;
        margin: 0 0 4px !important;
    }
    .cart-widget {
        align-self: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .cart-widget .cart-link { font-size: 15px; gap: 4px; }
    .cart-widget .cart-bag { font-size: 18px; }

    /* Mobile nav: MENU label left, hamburger right */
    .primary-nav .primary-menu { display: none; flex-direction: column; }
    .primary-nav .primary-menu.is-open { display: flex; }
    .primary-nav .primary-menu li a { border-top: 1px solid rgba(255, 255, 255, 0.08); }

    .primary-nav-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 4px 6px 16px;
        color: var(--t-nav-fg);
    }
    .primary-nav-mobile-bar .menu-label {
        font-size: 14px;
        font-weight: bold;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .primary-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px; height: 38px;
        padding: 0;
    }
    .primary-nav-toggle .bars { width: 22px; }
}

@media (max-width: 520px) {
    ul.products li.product { width: 100%; margin: 0 0 16px; }
}
