/* =========================================================
   Shop — green / black / white theme
   ========================================================= */
:root {
    --green: #16a34a;
    --green-dark: #15803d;
    --green-deeper: #14532d;
    --green-light: #dcfce7;
    --green-xlight: #f0fdf4;
    --black: #111827;
    --gray: #4b5563;
    --gray-mid: #9ca3af;
    --gray-light: #e5e7eb;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,.12);
}

/* ── Page header ── */
.shop-page-header {
    background: linear-gradient(135deg, #111827 0%, #14532d 100%);
    color: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.shop-page-header h1 { font-size: 2rem; font-weight: 700; margin: 0 0 .5rem; }
.shop-page-header p  { color: #d1fae5; margin: 0; font-size: 1rem; }

/* ── Layout ── */
.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .shop-layout { grid-template-columns: 1fr; }
}
.shop-layout-full {
    max-width: 900px;
    margin: 0 auto 3rem;
    width: 100%;
}

/* ── Sidebar filters ── */
.shop-sidebar {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
    box-shadow: var(--shadow);
}
.shop-sidebar h3 {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-mid);
    margin: 0 0 .75rem;
}
.filter-section { margin-bottom: 1.25rem; }
.filter-section label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--black);
    cursor: pointer;
    padding: .25rem 0;
}
.filter-section label:hover { color: var(--green); }
.filter-link {
    display: block;
    padding: .3rem .5rem;
    font-size: .875rem;
    color: var(--gray);
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.filter-link:hover, .filter-link.active {
    background: var(--green-light);
    color: var(--green-dark);
    font-weight: 600;
}
.filter-input {
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--black);
    outline: none;
    margin-top: .25rem;
}
.filter-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }

/* ── Product grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* ── Product card ── */
.product-card {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.product-card-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--green-xlight);
    position: relative;
}
.product-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-img .no-img {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--green);
}
.product-badge {
    position: absolute;
    top: .5rem; left: .5rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .5rem;
    border-radius: 20px;
}
.badge-downloadable { background: #dbeafe; color: #1d4ed8; }
.badge-physical     { background: var(--green-light); color: var(--green-dark); }
.badge-featured     { background: #fef3c7; color: #92400e; }

.product-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-vendor {
    font-size: .75rem;
    color: var(--gray-mid);
    margin-bottom: .25rem;
}
.product-card-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-name:hover { color: var(--green); }
.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-top: auto;
    padding-top: .5rem;
}
.product-card-actions {
    padding: .75rem 1rem 1rem;
    border-top: 1px solid var(--green-xlight);
    display: flex;
    gap: .5rem;
}

/* ── Featured row ── */
.featured-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ── Product detail ── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
}
.product-gallery-main {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--green-xlight);
    border: 1px solid var(--gray-light);
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}
.product-gallery-thumbs img {
    width: 60px; height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--gray-light);
    cursor: pointer;
    transition: border-color .15s;
}
.product-gallery-thumbs img:hover,
.product-gallery-thumbs img.active { border-color: var(--green); }

.product-info-panel { }
.product-info-vendor {
    font-size: .8rem;
    color: var(--gray-mid);
    margin-bottom: .25rem;
}
.product-info-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--black);
    line-height: 1.25;
    margin-bottom: .75rem;
}
.product-info-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 1rem;
}
.product-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.product-meta-tag {
    font-size: .8rem;
    padding: .2rem .7rem;
    border-radius: 20px;
    background: var(--green-light);
    color: var(--green-dark);
    font-weight: 500;
}
.product-info-desc {
    color: var(--gray);
    font-size: .95rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}
.product-info-stock {
    font-size: .85rem;
    color: var(--gray);
    margin-bottom: .75rem;
}
.product-info-stock .in-stock  { color: var(--green-dark); font-weight: 600; }
.product-info-stock .out-stock { color: #dc2626; font-weight: 600; }

/* Add-to-cart row */
.add-to-cart-row {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}
.qty-input {
    width: 70px;
    padding: .6rem .5rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

/* ── Cart ── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .cart-layout { grid-template-columns: 1fr; }
}
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-light);
}
.cart-table th {
    background: var(--green-xlight);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--green-dark);
}
.cart-table td {
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    vertical-align: middle;
}
.cart-item-img {
    width: 60px; height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--green-xlight);
}
.cart-item-name { font-weight: 600; color: var(--black); font-size: .95rem; }
.cart-item-vendor { font-size: .75rem; color: var(--gray-mid); }
.cart-qty-input {
    width: 60px;
    padding: .3rem .4rem;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    text-align: center;
    font-size: .9rem;
}

.cart-summary {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 1rem;
}
.cart-summary h3 { font-size: 1rem; font-weight: 700; color: var(--black); margin: 0 0 1rem; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    color: var(--gray);
    margin-bottom: .5rem;
}
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--black);
    padding-top: .75rem;
    border-top: 1px solid var(--gray-light);
    margin-top: .75rem;
}
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-mid);
}
.cart-empty .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ── Checkout form ── */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .checkout-layout { grid-template-columns: 1fr; }
}
.form-section {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.form-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--green-dark);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--green-xlight);
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: .35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: .9rem;
    color: var(--black);
    background: var(--white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-hint { font-size: .8rem; color: var(--gray-mid); margin-top: .25rem; }
.is-invalid { border-color: #ef4444 !important; }
.invalid-feedback { font-size: .8rem; color: #ef4444; display: block; margin-top: .2rem; }

/* Order summary in checkout sidebar */
.checkout-summary {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 1rem;
}
.checkout-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .75rem 0;
    border-bottom: 1px solid var(--green-xlight);
}
.checkout-item:last-of-type { border-bottom: none; }
.checkout-item-img {
    width: 48px; height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--green-xlight);
    flex-shrink: 0;
}
.checkout-item-name { font-size: .875rem; font-weight: 600; color: var(--black); }
.checkout-item-meta { font-size: .75rem; color: var(--gray-mid); }
.checkout-item-price { font-size: .875rem; font-weight: 700; color: var(--green-dark); margin-left: auto; flex-shrink: 0; }

/* ── Orders list ── */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow);
}
.orders-table th {
    background: var(--green-xlight);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--green-dark);
}
.orders-table td {
    padding: .9rem 1rem;
    border-top: 1px solid var(--gray-light);
    font-size: .9rem;
    color: var(--gray);
}
.orders-table tr:hover td { background: var(--green-xlight); }

/* Order detail */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}
@media (max-width: 768px) {
    .order-detail-grid { grid-template-columns: 1fr; }
}
.order-meta-box {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.order-meta-box h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green-dark); margin: 0 0 .75rem; }
.order-meta-row { display: flex; justify-content: space-between; font-size: .875rem; color: var(--gray); padding: .3rem 0; }
.order-meta-row strong { color: var(--black); }

/* ── Status badges ── */
.status-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .6rem;
    border-radius: 20px;
}
.status-pending    { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-shipped    { background: #e0e7ff; color: #3730a3; }
.status-completed  { background: var(--green-light); color: var(--green-dark); }
.status-cancelled  { background: #fee2e2; color: #991b1b; }
.status-paid       { background: var(--green-light); color: var(--green-dark); }
.status-failed     { background: #fee2e2; color: #991b1b; }
.status-draft      { background: var(--gray-light); color: var(--gray); }
.status-active     { background: var(--green-light); color: var(--green-dark); }
.status-inactive   { background: #fee2e2; color: #991b1b; }

/* ── My Products list ── */
.my-products-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow);
}
.my-products-table th {
    background: var(--green-xlight);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--green-dark);
}
.my-products-table td {
    padding: .9rem 1rem;
    border-top: 1px solid var(--gray-light);
    vertical-align: middle;
    font-size: .9rem;
}
.my-products-table tr:hover td { background: var(--green-xlight); }
.product-thumb-sm {
    width: 44px; height: 44px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--green-xlight);
}

/* ── Buttons ── */
.btn-green {
    background: var(--green);
    color: var(--white);
    border: none;
    padding: .6rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s;
}
.btn-green:hover { background: var(--green-dark); color: var(--white); }
.btn-outline {
    background: transparent;
    color: var(--green-dark);
    border: 1.5px solid var(--green);
    padding: .6rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--green-light); }
.btn-danger {
    background: #dc2626;
    color: var(--white);
    border: none;
    padding: .6rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s;
}
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }

/* ── Upload box ── */
.upload-box {
    display: block;
    border: 2px dashed var(--green-light);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--green-xlight);
}
.upload-box:hover { border-color: var(--green); background: var(--green-light); }
.upload-box input[type="file"] { display: none; }
.upload-box-label { display: block; font-size: .9rem; font-weight: 600; color: var(--green-dark); margin-bottom: .25rem; }
.upload-box-sub   { font-size: .75rem; color: var(--gray-mid); }

/* ── Download section in order detail ── */
.download-box {
    background: var(--green-xlight);
    border: 1px solid var(--green-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.download-box-info { font-size: .875rem; color: var(--black); font-weight: 500; }
.download-box-meta { font-size: .75rem; color: var(--gray-mid); margin-top: .2rem; }

/* ── Back link ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--green-dark);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--green); }

/* ── Pagination ── */
.pagination-wrap { margin-top: 2rem; display: flex; justify-content: center; }
