/**
 * Epiphany Studios — WooCommerce Styles
 */

.woocommerce { font-family: var(--ep-font-body); color: var(--ep-text); }

/* ============================================
   PRODUCT ARCHIVE / SHOP
   ============================================ */
.ep-shop-header { margin-bottom: 32px; }

.ep-shop-title {
    font-family: var(--ep-font-heading);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
}

.ep-shop-layout { display: flex; gap: 40px; }

.ep-shop-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.ep-shop-products { flex: 1; min-width: 0; }
.ep-shop-products.full-width { width: 100%; }

.ep-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
    color: #555;
}

.ep-shop-toolbar .woocommerce-ordering select {
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-family: var(--ep-font-body);
    font-size: 14px;
    border-radius: 0;
}

/* Product grid */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 0;
    margin: 0;
}

/* Product card */
.ep-product-card {
    list-style: none;
    text-align: center;
}

.ep-product-card-link {
    display: block;
    text-decoration: none;
    color: var(--ep-text);
}

.ep-product-card-link:hover { text-decoration: none; }

.ep-product-card-image { overflow: hidden; position: relative; }

.ep-product-card-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ep-product-card:hover .ep-product-card-image img { transform: scale(1.03); }

.ep-product-card-title {
    font-family: var(--ep-font-body);
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 4px;
}

.ep-product-card .price { font-size: 16px; }

.ep-product-card-actions { margin-top: 8px; }

.ep-product-card-actions .button {
    background: var(--ep-btn-bg) !important;
    color: var(--ep-btn-text) !important;
    border: none;
    border-radius: 0 !important;
    font-family: var(--ep-font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 24px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}

.ep-product-card-actions .button:hover { opacity: 0.8; }

/* Sale badge */
.woocommerce span.onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    border-radius: 0 !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    min-height: auto;
    min-width: auto;
    line-height: 1.4;
    z-index: 2;
}

.ep-shop-pagination { margin-top: 40px; text-align: center; }

/* ============================================
   SINGLE PRODUCT
   ============================================ */
.ep-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 48px;
}

.ep-product-gallery img { border-radius: 0 !important; }
.ep-product-gallery .woocommerce-product-gallery { margin-bottom: 0; }

.ep-product-summary .product_title {
    font-family: var(--ep-font-heading);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    margin-bottom: 8px;
}

.ep-product-summary .price {
    font-size: 22px;
    margin-bottom: 16px;
}

.ep-product-summary .woocommerce-product-details__short-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
    color: #555;
}

.ep-product-summary .variations td,
.ep-product-summary .variations th {
    border: none;
    padding: 8px 0;
    font-size: 16px;
}

.ep-product-summary .variations select {
    border: 1px solid #ccc;
    border-radius: 0 !important;
    padding: 10px 14px;
    font-size: 16px;
}

.woocommerce .quantity .qty {
    border: 1px solid #ccc;
    border-radius: 0 !important;
    padding: 10px;
    width: 70px;
    text-align: center;
    font-size: 16px;
}

.single_add_to_cart_button {
    background: var(--ep-btn-bg) !important;
    color: var(--ep-btn-text) !important;
    border-radius: 0 !important;
    border: none;
    font-family: var(--ep-font-body);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 40px;
    transition: opacity 0.2s;
}

.single_add_to_cart_button:hover { opacity: 0.8; }

.ep-product-summary .product_meta {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #555;
}

/* Tabs */
.ep-product-tabs { margin-top: 48px; }

.woocommerce-tabs .wc-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 0;
    margin: 0;
    list-style: none;
}

.woocommerce-tabs .wc-tabs li { margin: 0; }

.woocommerce-tabs .wc-tabs li a {
    display: block;
    padding: 12px 24px;
    font-family: var(--ep-font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
}

.woocommerce-tabs .wc-tabs li.active a { color: var(--ep-text); border-bottom-color: var(--ep-text); }
.woocommerce-tabs .wc-tabs li a:hover { color: var(--ep-text); text-decoration: none; }

.woocommerce-tabs .woocommerce-Tabs-panel { padding: 24px 0; }

/* Related / Upsells */
.related.products h2,
.upsells.products h2 {
    font-family: var(--ep-font-heading);
    font-size: 24px;
    margin-bottom: 24px;
}

/* ============================================
   CART PAGE
   ============================================ */
.ep-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: start;
}

.ep-cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 1fr 40px;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ep-text);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ep-cart-row {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 1fr 40px;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.ep-cart-col-product { display: flex; gap: 16px; align-items: center; }

.ep-cart-product-thumb { width: 80px; flex-shrink: 0; }
.ep-cart-product-thumb img { width: 100%; }

.ep-cart-product-name { font-size: 16px; font-weight: 600; }
.ep-cart-product-name a { color: var(--ep-text); text-decoration: none; }
.ep-cart-product-name a:hover { text-decoration: underline; }

.ep-cart-remove {
    font-size: 24px;
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: color 0.2s;
}

.ep-cart-remove:hover { color: #c00; text-decoration: none; }

.ep-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 12px;
}

.ep-coupon { display: flex; gap: 8px; }

.ep-coupon input {
    border: 1px solid #ccc;
    padding: 10px 14px;
    font-size: 14px;
    width: 200px;
    border-radius: 0;
}

.ep-btn-outline {
    background: transparent !important;
    color: var(--ep-text) !important;
    border: 1px solid var(--ep-text) !important;
}

.ep-btn-outline:hover { background: var(--ep-text) !important; color: var(--ep-bg) !important; }

/* Cart totals sidebar */
.ep-cart-totals-inner {
    background: #fafafa;
    padding: 32px;
    border: 1px solid #eee;
}

.ep-cart-totals-inner h2 {
    font-family: var(--ep-font-heading);
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ep-text);
}

.ep-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid #eee;
}

.ep-totals-total { font-weight: 700; font-size: 18px; border-bottom: none; padding-top: 16px; }

.ep-totals-shipping { padding: 10px 0; border-bottom: 1px solid #eee; }

.ep-totals-checkout { margin-top: 20px; }

.ep-totals-checkout .checkout-button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    font-family: var(--ep-font-body);
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border: none;
    border-radius: 0;
    transition: opacity 0.2s;
    text-decoration: none;
}

.ep-totals-checkout .checkout-button:hover { opacity: 0.8; text-decoration: none; }

/* ============================================
   CHECKOUT
   ============================================ */
.ep-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: start;
}

.ep-checkout-section { margin-bottom: 32px; }

.ep-checkout-section h3 {
    font-family: var(--ep-font-heading);
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.ep-checkout-fields .form-row {
    margin-bottom: 16px;
}

.ep-checkout-fields .form-row label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ep-checkout-fields .form-row input,
.ep-checkout-fields .form-row select,
.ep-checkout-fields .form-row textarea {
    border: 1px solid #ccc;
    border-radius: 0 !important;
    padding: 12px 14px;
    font-size: 16px;
    width: 100%;
}

.ep-checkout-review {
    background: #fafafa;
    padding: 32px;
    border: 1px solid #eee;
    position: sticky;
    top: 80px;
}

.ep-checkout-review h3 {
    font-family: var(--ep-font-heading);
    font-size: 22px;
    margin-bottom: 16px;
}

/* Shipping note + tooltip */
.ep-shipping-note {
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ep-tooltip {
    position: relative;
    cursor: help;
    display: inline-block;
    margin-left: 4px;
}

.ep-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #666;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    line-height: 1;
    vertical-align: middle;
}

.ep-tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background: #333;
    color: #fff;
    text-align: left;
    border-radius: 4px;
    padding: 10px 12px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    line-height: 1.5;
    transition: opacity 0.2s;
}

.ep-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.ep-tooltip:hover .ep-tooltip-text { visibility: visible; opacity: 1; }

/* Order review table in checkout */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border: none;
    border-collapse: collapse;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.woocommerce-checkout-review-order-table th { font-weight: 600; }
.woocommerce-checkout-review-order-table td { text-align: right; }

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid var(--ep-text);
    border-bottom: none;
    padding-top: 16px;
}

#place_order {
    display: block;
    width: 100%;
    background: var(--ep-btn-bg) !important;
    color: var(--ep-btn-text) !important;
    font-family: var(--ep-font-body);
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border: none;
    border-radius: 0 !important;
    margin-top: 20px;
    transition: opacity 0.2s;
    cursor: pointer;
}

#place_order:hover { opacity: 0.8; }

/* Payment methods */
.woocommerce-checkout-payment {
    margin-top: 20px;
}

.wc_payment_methods {
    padding: 0;
    list-style: none;
}

.wc_payment_method {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.wc_payment_method label {
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.payment_box { padding: 12px 0 0 24px; font-size: 14px; color: #555; }

/* ============================================
   MY ACCOUNT
   ============================================ */
.ep-myaccount-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: start;
}

.ep-myaccount-nav .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ep-myaccount-nav .woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid #eee;
}

.ep-myaccount-nav .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 14px 0;
    font-size: 15px;
    color: var(--ep-text);
    text-decoration: none;
    transition: color 0.2s;
}

.ep-myaccount-nav .woocommerce-MyAccount-navigation ul li a:hover { color: #555; }

.ep-myaccount-nav .woocommerce-MyAccount-navigation ul li.is-active a {
    font-weight: 700;
    border-right: 2px solid var(--ep-text);
}

/* Dashboard cards */
.ep-dashboard-welcome { margin-bottom: 32px; }
.ep-dashboard-welcome h2 { font-family: var(--ep-font-heading); font-size: 28px; margin-bottom: 8px; }
.ep-dashboard-welcome p { color: #555; line-height: 1.6; }
.ep-dashboard-welcome a { color: var(--ep-text); text-decoration: underline; }

.ep-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ep-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 16px;
    border: 1px solid #eee;
    text-decoration: none;
    color: var(--ep-text);
    font-family: var(--ep-font-body);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.ep-dashboard-card:hover {
    border-color: var(--ep-text);
    background: var(--ep-accent);
    text-decoration: none;
}

/* Orders table */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-orders-table th {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 0;
    border-bottom: 2px solid var(--ep-text);
    text-align: left;
}

.woocommerce-orders-table td {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.woocommerce-orders-table .woocommerce-button {
    font-size: 13px;
    padding: 8px 16px;
}

/* ============================================
   NOTICES
   ============================================ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: 0 !important;
    font-family: var(--ep-font-body);
    font-size: 14px;
    border-top: 2px solid var(--ep-text);
    background: var(--ep-accent);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.woocommerce-error { border-top-color: #c00; }

/* Breadcrumbs */
.ep-breadcrumbs {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}

.ep-breadcrumbs a { color: #888; text-decoration: none; }
.ep-breadcrumbs a:hover { color: var(--ep-text); }

/* ============================================
   PAGINATION
   ============================================ */
.woocommerce-pagination .page-numbers {
    display: inline-block;
    border: 1px solid #eee;
    padding: 8px 14px;
    font-size: 14px;
    text-decoration: none;
    color: var(--ep-text);
    transition: all 0.2s;
}

.woocommerce-pagination .page-numbers.current,
.woocommerce-pagination .page-numbers:hover {
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    border-color: var(--ep-btn-bg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .ep-product-layout { grid-template-columns: 1fr; gap: 32px; }
    .ep-cart-layout { grid-template-columns: 1fr; }
    .ep-checkout-layout { grid-template-columns: 1fr; }
    .ep-checkout-review { position: static; }
    .ep-myaccount-layout { grid-template-columns: 1fr; }
    .ep-shop-layout { flex-direction: column; }
    .ep-shop-sidebar { width: 100%; }
}

@media (max-width: 768px) {
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    .ep-cart-header { display: none; }

    .ep-cart-row {
        grid-template-columns: 80px 1fr;
        gap: 12px;
    }

    .ep-cart-col-product { grid-column: 1 / -1; }

    .ep-cart-col-price,
    .ep-cart-col-qty,
    .ep-cart-col-total {
        grid-column: 2;
    }

    .ep-cart-col-price::before,
    .ep-cart-col-qty::before,
    .ep-cart-col-total::before {
        content: attr(data-label) ': ';
        font-weight: 600;
        margin-right: 4px;
    }

    .ep-cart-col-remove {
        position: absolute;
        top: 20px;
        right: 0;
    }

    .ep-cart-row { position: relative; }

    .ep-cart-actions { flex-direction: column; }
    .ep-coupon { width: 100%; }
    .ep-coupon input { flex: 1; width: auto; }

    .ep-dashboard-grid { grid-template-columns: repeat(2, 1fr); }

    .woocommerce-tabs .wc-tabs { flex-direction: column; border-bottom: none; }
    .woocommerce-tabs .wc-tabs li a { border-bottom: 1px solid #eee; }
}

@media (max-width: 480px) {
    .woocommerce ul.products { grid-template-columns: 1fr; }
    .ep-dashboard-grid { grid-template-columns: 1fr; }
}
