/* =====================================================================
   Crypto Corner Shop — product page
   Two jobs:
     1. .ccs-product wraps the EXISTING components/item.php markup and
        restyles it in place, so the cart, buy-now and attribute logic in
        that file is never touched.
     2. .pd-* rules style the new sections appended below it.
   ===================================================================== */

.ccs-product,
.ccs-pdx {
    --p-gold: #EBA71A;
    --p-gold-soft: #FFF6E3;
    --p-green: #2F4238;
    --p-green-soft: #EEF3F0;
    --p-ink: #1D2A24;
    --p-muted: #6C7A73;
    --p-line: #E7ECE9;
    --p-card: #FFFFFF;
    --p-bg: #F7F9F8;
    --p-radius: 16px;
    --p-shadow: 0 1px 2px rgba(29,42,36,.04), 0 10px 26px rgba(29,42,36,.06);
    color: var(--p-ink);
    font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ccs-pdx { background: var(--p-bg); }

.ccs-product h1, .ccs-product h2, .ccs-product h3, .ccs-product h4, .ccs-product h5, .ccs-product h6,
.ccs-pdx h1, .ccs-pdx h2, .ccs-pdx h3, .ccs-pdx h4, .ccs-pdx h5, .ccs-pdx h6 {
    font-family: 'Raleway', 'Open Sans', sans-serif;
    color: var(--p-green); font-weight: 800; letter-spacing: -.01em;
}
.ccs-pdx a { text-decoration: none; }
.ccs-pdx .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   Restyling the existing item.php markup, by class only
   ===================================================================== */
.ccs-product { background: #fff; }

.ccs-product .border,
.ccs-product .border-secondary { border-color: var(--p-line) !important; }

/* Main image + gallery thumbs */
.ccs-product img.img-fluid { border-radius: 12px; }
.ccs-product .rounded { border-radius: 12px !important; }

/* Price block */
.ccs-product .price_coin {
    background: var(--p-gold-soft) !important;
    color: #A9760A !important;
    border-radius: 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 1.35rem !important;
}
.ccs-product .price_usd {
    color: var(--p-muted) !important;
    font-size: .9rem !important;
}
.ccs-product .original-price { text-decoration: line-through; opacity: .7; }
.ccs-product .discounted-price { color: var(--p-green) !important; font-weight: 800; }

/* Buttons inside the existing markup */
.ccs-product .btn-primary,
.ccs-product .btn.bg-primary {
    background: var(--p-gold) !important;
    border-color: var(--p-gold) !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-weight: 700;
}
.ccs-product .btn-primary:hover { background: #d4930f !important; border-color: #d4930f !important; }
.ccs-product .btn-secondary {
    background: var(--p-green) !important; border-color: var(--p-green) !important;
    color: #fff !important; border-radius: 10px !important; font-weight: 700;
}
.ccs-product .text-primary { color: var(--p-green) !important; }
.ccs-product .text-secondary { color: var(--p-gold) !important; }

/* Tabs inside item.php */
.ccs-product .nav-tabs { border-bottom: 1px solid var(--p-line) !important; gap: 4px; }
.ccs-product .nav-tabs .nav-link {
    border: 0 !important; border-bottom: 3px solid transparent !important;
    color: var(--p-muted) !important; font-weight: 700; font-size: .92rem; padding: 12px 18px !important;
    background: transparent !important; border-radius: 0 !important;
}
.ccs-product .nav-tabs .nav-link:hover { color: var(--p-green) !important; }
.ccs-product .nav-tabs .nav-link.active {
    color: var(--p-green) !important; border-bottom-color: var(--p-gold) !important; background: transparent !important;
}

/* =====================================================================
   New sections
   ===================================================================== */
.pd-section { padding: 34px 0; }
.pd-section + .pd-section { padding-top: 0; }

.pd-card {
    background: var(--p-card); border: 1px solid var(--p-line);
    border-radius: var(--p-radius); padding: 22px;
}
.pd-card h5 {
    font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--p-muted); font-weight: 800; margin-bottom: 16px;
}
.pd-card h5 i { color: var(--p-gold); margin-right: 7px; }

.pd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-head h2 { font-size: 1.25rem; margin: 0; }
.pd-head p { color: var(--p-muted); font-size: .85rem; margin: 4px 0 0; }

/* ------------------------------------------------------------ buttons */
.pd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--p-gold, #EBA71A); color: #fff !important;
    border: 1px solid var(--p-gold, #EBA71A);
    padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: .86rem;
    transition: all .18s ease; white-space: nowrap;
}
.pd-btn:hover { background: #d4930f; border-color: #d4930f; color: #fff !important; }
.pd-btn.ghost { background: #fff; color: var(--p-green, #2F4238) !important; border-color: var(--p-line, #E7ECE9); }
.pd-btn.ghost:hover { border-color: var(--p-gold); background: var(--p-gold-soft); }
.pd-btn.block { width: 100%; }
.pd-btn.sm { padding: 8px 13px; font-size: .8rem; }

.pd-input, .pd-select {
    width: 100%; background: #fff; color: var(--p-ink); border: 1px solid var(--p-line);
    border-radius: 10px; padding: 10px 12px; font-size: .86rem; outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.pd-input:focus, .pd-select:focus { border-color: var(--p-gold); box-shadow: 0 0 0 3px rgba(235,167,26,.12); }

/* ------------------------------------------------------------- trust */
.pd-trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.pd-trust-item { display: flex; gap: 12px; align-items: flex-start; }
.pd-trust-item .ico {
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--p-gold-soft); color: #A9760A; font-size: .95rem;
}
.pd-trust-item .t { font-size: .87rem; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.pd-trust-item .s { font-size: .78rem; color: var(--p-muted); margin-top: 3px; line-height: 1.45; }

/* ----------------------------------------------------------- shipping */
.pd-ship-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pd-ship-row .pd-select { flex: 1 1 200px; width: auto; }

.pd-quote { margin-top: 16px; border-radius: 12px; padding: 16px; border: 1px solid var(--p-line); background: #FBFDFC; }
.pd-quote.ok  { border-color: rgba(30,122,69,.3); background: #F2FAF5; }
.pd-quote.bad { border-color: rgba(179,38,30,.28); background: #FDF4F3; }
.pd-quote-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pd-quote-total { font-family: 'Raleway', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--p-green); }
.pd-quote-total.free { color: #1E7A45; }
.pd-quote-label { font-size: .8rem; color: var(--p-muted); }
.pd-quote-lines { margin-top: 12px; }
.pd-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--p-line); font-size: .84rem; }
.pd-kv:last-child { border-bottom: 0; }
.pd-kv .k { color: var(--p-muted); }
.pd-kv .v { font-weight: 600; text-align: right; }

.pd-note { font-size: .8rem; color: var(--p-muted); margin-top: 10px; line-height: 1.55; }
.pd-badge {
    display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
}
.pd-badge.good { background: #E4F4EA; color: #1E7A45; }
.pd-badge.warn { background: var(--p-gold-soft); color: #A9760A; }
.pd-badge.bad  { background: #FDE7E7; color: #B3261E; }
.pd-badge.info { background: var(--p-green-soft); color: var(--p-green); }

/* --------------------------------------------------------------- spec */
.pd-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 26px; }

/* ------------------------------------------------------------- seller */
.pd-seller { display: flex; gap: 16px; align-items: flex-start; }
.pd-seller img { width: 66px; height: 66px; border-radius: 14px; object-fit: cover; background: var(--p-green-soft); flex: 0 0 auto; }
.pd-seller .nm { font-size: 1rem; font-weight: 800; color: var(--p-green); line-height: 1.3; }
.pd-seller .meta { font-size: .8rem; color: var(--p-muted); margin-top: 3px; }
.pd-stars { color: #D8E0DB; font-size: .8rem; }
.pd-stars .fa-star.text-secondary { color: var(--p-gold) !important; }
.pd-seller-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.pd-seller-stats .n { font-family: 'Raleway', sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--p-green); line-height: 1; }
.pd-seller-stats .l { font-size: .68rem; color: var(--p-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 4px; }

.pd-coins { display: flex; flex-wrap: wrap; gap: 5px; }
.pd-coin {
    background: var(--p-gold-soft); color: #A9760A; font-size: .68rem;
    font-weight: 800; padding: 3px 8px; border-radius: 5px; letter-spacing: .03em;
}

/* ------------------------------------------------------------ related */
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.pd-item {
    background: var(--p-card); border: 1px solid var(--p-line); border-radius: 14px;
    overflow: hidden; display: flex; flex-direction: column; height: 100%;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pd-item:hover { transform: translateY(-4px); box-shadow: var(--p-shadow); border-color: #DCE4E0; }
.pd-item-img { position: relative; aspect-ratio: 1/1; background: var(--p-green-soft); overflow: hidden; display: block; }
.pd-item-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pd-item:hover .pd-item-img img { transform: scale(1.05); }
.pd-flag {
    position: absolute; top: 9px; left: 9px; font-size: .66rem; font-weight: 800;
    padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em;
}
.pd-flag.sale { background: #E53935; color: #fff; }
.pd-flag.oos { background: rgba(29,42,36,.85); color: #fff; top: auto; bottom: 9px; }
.pd-item-coin {
    position: absolute; top: 9px; right: 9px; background: rgba(255,255,255,.94);
    color: #A9760A; font-size: .66rem; font-weight: 800; padding: 3px 8px; border-radius: 6px;
}
.pd-item-body { padding: 12px 13px 13px; display: flex; flex-direction: column; flex: 1; }
.pd-item-cat { font-size: .66rem; color: var(--p-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.pd-item-name {
    font-size: .88rem; font-weight: 700; line-height: 1.35; margin: 0 0 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pd-item-name a { color: var(--p-green); }
.pd-item:hover .pd-item-name a { color: #C2900F; }
.pd-item-price { margin-top: auto; font-family: 'Raleway', sans-serif; font-size: 1rem; font-weight: 800; color: var(--p-green); }
.pd-item-price s { font-size: .76rem; font-weight: 600; color: var(--p-muted); margin-left: 6px; }
.pd-item-store { font-size: .72rem; color: var(--p-muted); margin-top: 5px; }

/* -------------------------------------------------------------- misc */
.pd-empty { text-align: center; padding: 40px 20px; color: var(--p-muted); grid-column: 1 / -1; }
.pd-empty i { font-size: 2rem; color: #CBD6D0; display: block; margin-bottom: 12px; }

.pd-skel { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 14px; overflow: hidden; }
.pd-skel .sk { background: linear-gradient(90deg, #EFF3F1 25%, #F7FAF8 50%, #EFF3F1 75%); background-size: 400% 100%; animation: pd-shim 1.3s ease infinite; }
.pd-skel .sk-img { aspect-ratio: 1/1; }
.pd-skel .sk-line { height: 11px; border-radius: 6px; margin: 11px 13px; }
.pd-skel .sk-line.short { width: 55%; }
@keyframes pd-shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* --------------------------------------------------------- responsive */
@media (max-width: 767.98px) {
    .pd-section { padding: 24px 0; }
    .pd-card { padding: 18px; }
    .pd-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .pd-seller { gap: 12px; }
    .pd-seller img { width: 54px; height: 54px; }
}

/* =====================================================================
   description.php — the .product-container block
   Restyled by class only; that file is never edited.
   ===================================================================== */
.ccs-product .product-container {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius) !important;
    box-shadow: none !important;
    padding: 26px 28px !important;
    font-size: .92rem;
}
.ccs-product .product-header {
    border-bottom: 1px solid var(--p-line) !important;
    padding-bottom: 18px !important;
    margin-bottom: 20px !important;
}
.ccs-product .product-header h1 {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem) !important;
    font-weight: 800;
    color: var(--p-green);
    line-height: 1.25;
    margin-bottom: 10px !important;
}

/* Badges beside the title */
.ccs-product .product-header .badge {
    font-size: .68rem !important;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    margin-right: 5px;
}
.ccs-product .badge-custom { background: var(--p-green-soft) !important; color: var(--p-green) !important; }
.ccs-product .product-header .bg-info { background: var(--p-gold-soft) !important; color: #A9760A !important; }

/* Visit Shop / Chat — outlined, gold on hover, white text throughout the
   hover state including the icon. The extra .product-container in the
   selector outranks the template's own .btn-update:hover rule. */
.ccs-product .product-container .btn-update,
.ccs-product .product-container a.btn-update {
    border: 1px solid var(--p-line) !important;
    color: var(--p-green) !important;
    background: #fff !important;
    border-radius: 999px !important;
    font-size: .84rem !important;
    font-weight: 700;
    padding: 9px 18px !important;
    transition: all .18s ease !important;
}
.ccs-product .product-container .btn-update i { color: var(--p-gold) !important; transition: color .18s ease; }
.ccs-product .product-container .btn-update:hover,
.ccs-product .product-container a.btn-update:hover,
.ccs-product .product-container a.btn-update:focus {
    background: var(--p-gold) !important;
    border-color: var(--p-gold) !important;
    color: #fff !important;
}
.ccs-product .product-container .btn-update:hover i,
.ccs-product .product-container a.btn-update:hover i { color: #fff !important; }

/* Brand / condition panel */
.ccs-product .product-brand-condition {
    background: var(--p-green-soft) !important;
    border: 1px solid var(--p-line);
    border-radius: 12px !important;
    padding: 16px 18px !important;
    margin: 18px 0 !important;
}
.ccs-product .product-brand-condition h4,
.ccs-product .product-info h4 {
    font-size: .74rem !important;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 800 !important;
    color: var(--p-muted) !important;
    margin-bottom: 6px;
}
.ccs-product .product-brand-condition p,
.ccs-product .product-info p {
    font-size: .9rem !important;
    color: var(--p-ink) !important;
    line-height: 1.65;
}
.ccs-product .product-info-container { padding: 4px 0 !important; }

/* Tag pills */
.ccs-product .tags-section .badge {
    background: #fff !important;
    color: var(--p-muted) !important;
    border: 1px solid var(--p-line);
    font-size: .72rem !important;
    font-weight: 600;
    padding: 5px 11px !important;
    border-radius: 999px !important;
}
.ccs-product .tags-section .badge:hover { border-color: var(--p-gold); color: var(--p-green) !important; }

/* =====================================================================
   Select2 (the "Choose a Different Cryptocurrency" picker)
   ===================================================================== */
.ccs-product .select2-container { width: 100% !important; }
.ccs-product .select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1px solid var(--p-line) !important;
    border-radius: 10px !important;
    padding: 6px 8px !important;
}
.ccs-product .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.6 !important; color: var(--p-ink) !important; font-size: .9rem;
}
.ccs-product .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100% !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #EBA71A !important;
}
.select2-dropdown { border-color: #E7ECE9 !important; border-radius: 12px !important; overflow: hidden; }
.select2-search--dropdown .select2-search__field {
    border: 1px solid #E7ECE9 !important; border-radius: 8px !important; padding: 8px 10px !important;
}
.select2-results__option img { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }

/* =====================================================================
   item.php — the main buy block above the fold
   ===================================================================== */
.ccs-product > .container { padding-top: 1.5rem; }

.ccs-product .row.product-container {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 22px;
    margin: 0 0 26px;
}

/* Quantity stepper and inputs */
.ccs-product input.form-control,
.ccs-product select.form-select,
.ccs-product textarea.form-control {
    border-color: var(--p-line) !important;
    border-radius: 10px !important;
    font-size: .9rem;
}
.ccs-product input.form-control:focus,
.ccs-product select.form-select:focus {
    border-color: var(--p-gold) !important;
    box-shadow: 0 0 0 3px rgba(235,167,26,.12) !important;
}

/* Attribute option groups */
.ccs-product .form-check-label { font-size: .88rem; }
.ccs-product .form-label {
    font-size: .74rem !important;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 800;
    color: var(--p-muted);
}

/* Gallery thumbnails */
.ccs-product .fruite-img img,
.ccs-product .gallery-thumb img { border-radius: 10px; }

/* Review stars in the existing block */
.ccs-product .fa-star { color: var(--p-gold); }

/* Tables inside the description tab */
.ccs-product .table { font-size: .88rem; }
.ccs-product .table th { color: var(--p-muted); font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }

@media (max-width: 767.98px) {
    .ccs-product .product-container { padding: 18px !important; }
    .ccs-product .row.product-container { padding: 14px; }
}
