/*
Theme Name: CasiOAK Custom (Astra Child)
Theme URI: https://casiocustom.ru
Description: Дочерняя тема Astra для магазина кастомных часов Casio G-Shock
Author: CasiOAK Custom
Template: astra
Version: 1.0.0
*/

/* ===== CSS Variables ===== */
:root {
  --bg: #080808;
  --panel: #111;
  --panel-2: #181818;
  --line: #2a2a2a;
  --text: #f7f7f7;
  --muted: #a9a9a9;
  --accent: #e31e24;
  --accent-2: #ff343a;
  --radius: 18px;
  --shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 70% 0, #202020 0, #080808 34%, #050505 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ===== Top Bar ===== */
.topbar {
  height: 34px;
  display: flex;
  justify-content: center;
  gap: 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: #d6d6d6;
  background: #050505;
}

@media (max-width: 960px) {
  .topbar { display: none; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  background: rgba(7, 7, 7, .86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand span {
  font-family: Oswald, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
}

.brand span span {
  color: var(--accent);
}

.brand small {
  display: block;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11px;
  color: var(--muted);
}

.desktop-nav {
  display: flex;
  gap: 32px;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}

.desktop-nav a {
  padding: 29px 0;
  color: #ddd;
}

.desktop-nav a:hover,
.desktop-nav .active {
  color: #fff;
  border-bottom: 2px solid var(--accent);
}

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

.header-actions button,
.header-actions a {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.cart {
  position: relative;
}

.cart b {
  position: absolute;
  right: -8px;
  top: -8px;
  background: var(--accent);
  border-radius: 99px;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.menu-toggle {
  display: none !important;
}

@media (max-width: 960px) {
  .desktop-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(7, 7, 7, .96);
    padding: 20px 4vw;
    gap: 18px;
    border-bottom: 1px solid var(--line);
  }
  .desktop-nav.open { display: flex; }
  .desktop-nav a { padding: 8px 0; }
  .menu-toggle { display: block !important; }
}

@media (max-width: 620px) {
  .site-header { height: 64px; }
  .brand span { font-size: 22px; }
}

/* ===== Hero ===== */
.hero {
  min-height: 650px;
  padding: 70px 4vw 54px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 36px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .1)),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, .08), transparent 32%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
}

.hero h1 {
  font-family: Oswald, sans-serif;
  font-size: clamp(56px, 7vw, 108px);
  line-height: .92;
  margin: 0 0 28px;
  text-transform: uppercase;
}

.hero h1 span {
  color: var(--accent);
}

.lead {
  max-width: 610px;
  font-size: 20px;
  line-height: 1.7;
  color: #e4e4e4;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin: 34px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #b70d12);
  color: #fff;
}

.primary:hover {
  background: linear-gradient(135deg, var(--accent-2), #c91016);
}

.ghost {
  border: 1px solid #777;
  color: #fff;
  background: rgba(255, 255, 255, .03);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 710px;
}

.trust-row div {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  border-radius: var(--radius);
}

.trust-row strong {
  display: block;
  font-size: 22px;
}

.trust-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.hero-watch {
  min-height: 520px;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, #777 0 6%, #181818 7% 16%, #050505 17% 30%, transparent 31%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .02) 48%, transparent 49%),
    linear-gradient(145deg, #1b1b1b, #050505);
  box-shadow: var(--shadow);
}

.hero-watch:before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(55deg, transparent 0 42px, rgba(255, 255, 255, .04) 43px 46px);
}

.watch-face {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 24px solid #070707;
  background: radial-gradient(circle, #1a1a1a 0 60%, #0a0a0a 80%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .7), 0 0 0 4px #333;
}

.logo {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-family: Oswald, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #ddd;
}

.marker {
  position: absolute;
  background: #fff;
  width: 6px;
  height: 20px;
  border-radius: 2px;
}
.marker.top { left: 50%; top: 18px; transform: translateX(-50%); }
.marker.right { right: 18px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.marker.bottom { left: 50%; bottom: 18px; transform: translateX(-50%); }
.marker.left { left: 18px; top: 50%; transform: translateY(-50%) rotate(90deg); }

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: 50% 100%;
  background: #eee;
  border-radius: 2px;
}
.hand.hour { width: 5px; height: 70px; transform: translateX(-50%) rotate(45deg); }
.hand.minute { width: 3px; height: 100px; transform: translateX(-50%) rotate(190deg); }
.hand.second { width: 1px; height: 110px; background: var(--accent); transform: translateX(-50%) rotate(320deg); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 42px; }
  .hero-watch { min-height: 420px; }
}

@media (max-width: 620px) {
  .hero h1 { font-size: 54px; }
  .hero-cta, .trust-row { grid-template-columns: 1fr; display: grid; }
  .hero { padding-left: 18px; padding-right: 18px; }
}

/* ===== Sections ===== */
.section,
.features,
.builder,
.footer {
  padding: 72px 4vw;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.features article,
.product-card,
.category-card,
.builder,
.faq details {
  background: linear-gradient(180deg, var(--panel-2), #0d0d0d);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.features article { padding: 28px; }
.features span { color: var(--accent); font-weight: 900; }
.features h3 { font-size: 24px; margin: 12px 0; }
.features p,
.builder p,
.faq p,
.footer p {
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 960px) {
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .features { grid-template-columns: 1fr 1fr; }
  .section, .features, .builder, .footer { padding: 46px 18px; }
}

/* ===== Section Head ===== */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}

.section h2,
.builder h2,
.faq h2 {
  font-family: Oswald, sans-serif;
  font-size: 42px;
  margin: 0;
  text-transform: uppercase;
}

.section-head a {
  color: var(--accent);
  font-weight: 800;
}

/* ===== Categories ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.category-card {
  padding: 20px;
  text-align: center;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color .2s;
}

.category-card:hover {
  border-color: var(--accent);
}

.category-card img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
}

.category-card strong {
  display: block;
  margin-top: 16px;
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 960px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .category-card { min-height: 140px; }
}

/* ===== Products ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.product-card {
  position: relative;
  padding: 20px;
  transition: border-color .2s, transform .2s;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.product-card .wishlist-btn {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 2;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 24px;
  cursor: pointer;
}

.product-card a {
  display: block;
  color: inherit;
}

.product-watch-wrap {
  margin: 22px auto 0;
  text-align: center;
}

.product-watch-wrap img {
  width: 220px !important;
  height: 220px !important;
  max-width: 220px !important;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

.product-watch-wrap {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card h3 {
  font-size: 16px;
  margin: 18px 0 8px;
  font-weight: 600;
}

.product-card p {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 8px;
}

.product-card p .woocommerce-Price-amount {
  color: #fff;
}

.product-card span {
  color: #ffd338;
}

.product-card span small {
  color: var(--muted);
}

@media (max-width: 960px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .product-watch-wrap img { width: 150px; height: 150px; }
}

/* ===== Builder ===== */
.builder {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 32px;
  align-items: center;
  margin: 0 4vw 46px;
  border-radius: var(--radius);
}

.builder-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.builder-form label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
}

.builder-form select,
.builder-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #fff;
  font-size: 15px;
}

.builder-form textarea {
  min-height: 90px;
  resize: vertical;
}

@media (max-width: 960px) {
  .builder { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .builder { margin: 0 18px 46px; }
}

/* ===== FAQ ===== */
.faq {
  border-bottom: 1px solid var(--line);
}

.faq details {
  padding: 24px 28px;
  margin-bottom: 12px;
  cursor: pointer;
}

.faq summary {
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  outline: none;
}

.faq summary:hover {
  color: var(--accent-2);
}

.faq details[open] {
  border-color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 32px;
  background: #050505;
  border-top: 1px solid var(--line);
}

.footer strong {
  font-family: Oswald, sans-serif;
  font-size: 22px;
  letter-spacing: .06em;
}

.footer h4 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.footer a {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.footer a:hover {
  color: #fff;
}

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


/* ===== Standalone page — clean slate ===== */
body.casiocustom-home {
  margin: 0;
  background: radial-gradient(circle at 70% 0, #202020 0, #080808 34%, #050505 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
.casiocustom-home .topbar,
.casiocustom-home .site-header,
.casiocustom-home .hero,
.casiocustom-home .features,
.casiocustom-home .section,
.casiocustom-home .builder,
.casiocustom-home .faq,
.casiocustom-home .footer {
  width: 100% !important;
  max-width: 100% !important;
}


/* ===== Fallback for broken product images ===== */
.product-watch-wrap {
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border-radius: 12px;
  overflow: hidden;
}
.product-watch-wrap::before {
  content: 'CASIO\\A CUSTOM';
  white-space: pre;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  color: var(--muted);
  opacity: 0.4;
  display: none;
}
.product-watch-wrap img[src]:invalid + .product-watch-wrap::before,
.product-watch-wrap:has(img[src=""])::before {
  display: block;
}

/* Product image minimum dimensions — prevents 1x1 broken images */
.astra-shop-thumbnail-wrap img,
.woocommerce-LoopProduct-link img,
.attachment-woocommerce_thumbnail {
  min-width: 280px !important;
  min-height: 280px !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  background: #1a1a1a;
  display: block;
}
/* Product card dark theme */
ul.products li.product {
  background: #0B0B0B !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 4px;
  overflow: hidden;
}
ul.products li.product .astra-shop-summary-wrap {
  background: #0B0B0B !important;
  padding: 16px !important;
}
ul.products li.product h2,
ul.products li.product .woocommerce-loop-product__title {
  color: #FFFFFF !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
}
ul.products li.product .price {
  color: #E31E24 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}
ul.products li.product .button {
  background: #E31E24 !important;
  color: #000 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 12px !important;
  border: none !important;
  border-radius: 3px !important;
  padding: 10px 16px !important;
}
/* Pagination dark */
.woocommerce-pagination .page-numbers li .page-numbers {
  background: #1a1a1a !important;
  color: #A0A0A0 !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.woocommerce-pagination .page-numbers li .current {
  background: #E31E24 !important;
  color: #fff !important;
}
/* Breadcrumb dark */
.woocommerce-breadcrumb, .woocommerce-breadcrumb a {
  color: #A0A0A0 !important;
}
.woocommerce-breadcrumb a:hover {
  color: #E31E24 !important;
}

/* ===== PC产品页图片修复：横构图手表图不裁剪 ===== */
/* WooCommerce product gallery - use contain instead of cover */
.woocommerce div.product div.images .woocommerce-product-gallery__image img,
.woocommerce div.product div.images img,
.woocommerce-product-gallery__image img {
    object-fit: contain !important;
    background: #111;
}

/* Ensure gallery wrapper doesn't force square aspect ratio */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
    max-height: none !important;
}

/* Fix for Astra theme forcing cover */
.woocommerce div.product div.images .flex-viewport img,
.woocommerce div.product div.woocommerce-product-gallery__image {
    object-fit: contain !important;
}

/* Gallery thumbnail images - keep small cover */
.woocommerce div.product div.images .flex-control-thumbs img {
    object-fit: cover;
    height: 100px;
}

/* PC: ensure 2-column layout works properly */
@media (min-width: 921px) {
    .woocommerce div.product div.images {
        width: 50% !important;
        float: left;
    }
    .woocommerce div.product div.summary {
        width: 48% !important;
        float: right;
    }
}

/* ===== PC产品页图片修复v2：强制覆盖Flexslider内联样式 ===== */
/* Override flexslider's forced square height */
.woocommerce div.product div.images .flex-viewport {
    height: auto !important;
    min-height: 400px;
}

/* Ensure gallery images keep their natural aspect ratio */
.woocommerce div.product div.images .woocommerce-product-gallery__image img,
.woocommerce div.product div.images .flex-viewport img,
.woocommerce div.product div.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    object-fit: contain !important;
    display: block;
}

/* Gallery wrapper - don't force size */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
    max-height: none !important;
    height: auto !important;
}

/* Gallery image container */
.woocommerce div.product div.woocommerce-product-gallery__image {
    position: relative !important;
    overflow: visible !important;
}

/* Zoom lens fix */
.woocommerce div.product div.images .woocommerce-product-gallery__image a img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* ===== Hero collection image ===== */
.hero-watch {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-collection-img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
}
@media (max-width: 960px) {
    .hero-collection-img {
        max-height: 400px;
    }
}
@media (max-width: 620px) {
    .hero-collection-img {
        max-height: 300px;
    }
}

/* ===== Hero v2 — collection image as background ===== */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}
.hero-bg {
    position: absolute;
    right: -5%;
    top: 0;
    width: 55%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}
.hero-bg::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
    z-index: 1;
}
.hero-collection-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.7;
    filter: brightness(0.9);
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 50%;
}
@media (max-width: 960px) {
    .hero {
        flex-direction: column;
        min-height: auto;
    }
    .hero-bg {
        position: relative;
        width: 100%;
        height: 350px;
        right: 0;
        order: -1;
    }
    .hero-bg::after {
        width: 100%;
        height: 40%;
        top: auto;
        bottom: 0;
        background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    }
    .hero-content {
        max-width: 100%;
    }
}
/* ===== Product card — shorter titles ===== */
.product-card h3 {
    font-size: 14px;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== Broken image fallback ===== */
.product-card .product-watch-wrap {
    position: relative;
    background: #1a1a1a;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card .product-watch-wrap::before {
    content: '⌚';
    font-size: 60px;
    position: absolute;
    opacity: 0.3;
    z-index: 0;
}
.product-card .product-watch-wrap img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #1a1a1a;
}
/* If image fails to load, keep the watch emoji visible */
.product-card .product-watch-wrap img[src=""],
.product-card .product-watch-wrap img:not([src]) {
    display: none;
}

/* Image fallback */
.product-watch-wrap.no-img::after {
    content: '⌚';
    font-size: 64px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    z-index: 0;
}
.product-watch-wrap .img-fallback {
    font-size: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    opacity: 0.3;
}
