@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --shop-primary: #18181b;       /* Charcoal/Slate Shopify-like color */
    --shop-secondary: #27272a;
    --shop-accent: #0f766e;        /* Dark teal accent */
    --shop-danger: #b91c1c;
    --shop-warning: #d97706;
    --shop-dark: #09090b;
    --shop-gray: #71717a;
    --shop-light: #f4f4f5;
    --shop-border: #e4e4e7;
    --shop-radius: 8px;           /* Shopify-like sharp-soft corners */
    --shop-font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--shop-font);
    background-color: #fafafa;
    color: var(--shop-dark);
    margin: 0;
    padding-bottom: 40px;
    line-height: 1.5;
}

/* ── Header Hide Configuration ── */
body.page-shop-product header {
    display: none !important;
}
body.page-shop-product {
    padding-top: 0 !important;
    background-color: #ffffff;
}


/* ── Common Layout Containers ── */
.shop-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
}

.shop-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--shop-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

/* ── Product Card Grid ── */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}
@media (min-width: 1024px) {
    .shop-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ── Product Card Layout ── */
.shop-card {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.shop-card:hover {
    border-color: #a1a1aa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.shop-card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--shop-danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
    letter-spacing: 0.02em;
}
.shop-card-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1.45;
    background: #f4f4f5;
    overflow: hidden;
    position: relative;
    display: block;
}
.shop-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}
.shop-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.shop-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--shop-dark);
    margin: 0 0 4px 0;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}
.shop-card-title:hover {
    color: var(--shop-accent);
}
.shop-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 8px;
}
.shop-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--shop-dark);
}
.shop-card-old-price {
    font-size: 0.75rem;
    color: var(--shop-gray);
    text-decoration: line-through;
}
.shop-card-btn {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: #fff;
    color: var(--shop-primary);
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: auto;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.shop-card-btn:hover {
    background: var(--shop-primary);
    border-color: var(--shop-primary);
    color: #fff;
}

/* ── Single Product Details ── */
.sp-details-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    padding: 12px;
}
@media (min-width: 768px) {
    .sp-details-container {
        flex-direction: row;
        padding: 20px;
        gap: 24px;
    }
}
.sp-details-gallery-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex: 0 0 100%;
    width: 100%;
}
@media (min-width: 768px) {
    .sp-details-gallery-wrap {
        flex: 0 0 400px;
        width: 400px;
    }
}
.sp-gallery-thumbs-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 52px;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
}
.sp-gallery-thumbs-col::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
.sp-gallery-thumb {
    width: 52px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--shop-border);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.sp-gallery-thumb:hover, .sp-gallery-thumb.active {
    opacity: 1;
    border-color: var(--shop-primary);
}
.sp-gallery-main-wrap {
    flex: 1;
    min-width: 0;
}
.sp-details-image {
    width: 100%;
    aspect-ratio: 1 / 1.45;
    object-fit: cover;
    background: #f4f4f5;
    border-radius: 6px;
    border: 1px solid var(--shop-border);
}

/* ── Video Player (Story Style) ── */
.sp-video-container {
    margin-top: 16px;
    background: #000;
    border-radius: var(--shop-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 9 / 16;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 768px) {
    .sp-video-container {
        margin-left: 0;
        margin-right: 0;
    }
}
.sp-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sp-details-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--shop-dark);
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.sp-details-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    align-self: flex-start;
}
.sp-details-stock-in {
    background: #eefdf5;
    color: #0f766e;
}
.sp-details-stock-out {
    background: #fef2f2;
    color: #b91c1c;
}
.sp-details-price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
    border-top: 1px solid var(--shop-border);
    border-bottom: 1px solid var(--shop-border);
    padding: 10px 0;
    margin-bottom: 16px;
}
.sp-details-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--shop-dark);
}
.sp-details-old-price {
    font-size: 0.95rem;
    color: var(--shop-gray);
    text-decoration: line-through;
}
.sp-details-description {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 20px;
}
.sp-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.sp-details-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    height: 38px;
    overflow: hidden;
    background: #fff;
}
.sp-details-qty-btn {
    width: 32px;
    height: 100%;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp-details-qty-btn:hover {
    background: var(--shop-light);
}
.sp-details-qty-input {
    width: 40px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--shop-border);
    border-right: 1px solid var(--shop-border);
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    outline: none;
    pointer-events: none;
}
.sp-details-btn-cart {
    flex: 1;
    min-width: 140px;
    height: 38px;
    border: none;
    border-radius: 6px;
    background: var(--shop-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.15s;
}
.sp-details-btn-cart:hover {
    opacity: 0.9;
}
.sp-details-btn-read {
    height: 38px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: #fff;
    color: var(--shop-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    transition: background 0.15s;
}
.sp-details-btn-read:hover {
    background: var(--shop-light);
}

/* ── Cart Layout & Tables ── */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1.7fr 1fr;
        align-items: start;
        gap: 24px;
    }
}
.cart-table-card {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    padding: 12px;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--shop-border);
}
.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.cart-item:first-child {
    padding-top: 0;
}
.cart-item-image {
    width: 60px;
    height: 84px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--shop-border);
}
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cart-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--shop-dark);
    text-decoration: none;
    margin-bottom: 4px;
}
.cart-item-title:hover {
    color: var(--shop-accent);
}
.cart-item-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--shop-secondary);
}
.cart-item-qty-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-item-remove {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    transition: color 0.1s;
}
.cart-item-remove:hover {
    color: var(--shop-danger);
}

/* ── Cart Summary Card ── */
.checkout-summary {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    padding: 16px;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #4b5563;
}
.cart-summary-total {
    border-top: 1px solid var(--shop-border);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--shop-dark);
}
.cart-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 40px;
    border-radius: 6px;
    background: var(--shop-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    margin-top: 16px;
    transition: opacity 0.15s;
}
.cart-btn-checkout:hover {
    opacity: 0.9;
}

/* ── Checkout Form Elements ── */
.checkout-billing {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    padding: 16px;
}
.shop-form-group {
    margin-bottom: 12px;
}
.shop-form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.shop-form-control {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.shop-form-control:focus {
    border-color: #71717a;
}
textarea.shop-form-control {
    height: auto;
}

/* ── Alert Messages ── */
.shop-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.shop-alert-err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

/* ── Empty State ── */
.shop-empty-state {
    text-align: center;
    padding: 40px 16px;
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
}
.shop-empty-icon {
    font-size: 2.2rem;
    color: #d1d5db;
    margin-bottom: 12px;
}
.shop-empty-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px 0;
}
.shop-empty-text {
    font-size: 0.8rem;
    color: var(--shop-gray);
    margin: 0 0 16px 0;
}
.sp-submit {
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--shop-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Minimal Sub-Navbar for Single Product (Unified) ── */
.sp-mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--shop-border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}
.sp-mobile-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-dark);
    font-size: 1.1rem;
    text-decoration: none;
}
.sp-mobile-nav-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--shop-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
